chainy/node_modules/deck/bench/shuffle.js
2020-01-26 21:03:32 +02:00

11 lines
219 B
JavaScript

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);