chainy/node_modules/deck/bench/shuffle.js

11 lines
219 B
JavaScript
Raw Permalink Normal View History

2020-01-26 19:03:32 +00:00
var shuffle = require('../').shuffle;
var xs = [];
for (var i = 0; i < 1e5; i++) {
xs.push(Math.floor(Math.random() * 1e3));
}
var t0 = Date.now();
shuffle(xs);
var elapsed = Date.now() - t0;
console.log(elapsed);