Travis build: 1678 [cron]

This commit is contained in:
30secondsofcode
2018-02-14 20:22:35 +00:00
parent ce77e2b8b7
commit 3d13db0790
8 changed files with 2123 additions and 1914 deletions

View File

@ -0,0 +1,9 @@
const mostPerformant = (fns, iterations = 10000) => {
const times = fns.map(fn => {
const before = performance.now();
for (let i = 0; i < iterations; i++) fn();
return performance.now() - before;
});
return times.indexOf(Math.min(...times));
};
module.exports = mostPerformant;

View File

@ -0,0 +1,13 @@
const test = require('tape');
const mostPerformant = require('./mostPerformant.js');
test('Testing mostPerformant', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof mostPerformant === 'function', 'mostPerformant is a Function');
//t.deepEqual(mostPerformant(args..), 'Expected');
//t.equal(mostPerformant(args..), 'Expected');
//t.false(mostPerformant(args..), 'Expected');
//t.throws(mostPerformant(args..), 'Expected');
t.end();
});

File diff suppressed because it is too large Load Diff