diff options
Diffstat (limited to 'benchmark/timers/timers-insert-unpooled.js')
-rw-r--r-- | benchmark/timers/timers-insert-unpooled.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/benchmark/timers/timers-insert-unpooled.js b/benchmark/timers/timers-insert-unpooled.js index fbbeebb759..1f1c5155a7 100644 --- a/benchmark/timers/timers-insert-unpooled.js +++ b/benchmark/timers/timers-insert-unpooled.js @@ -3,21 +3,19 @@ const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { - millions: [1], + n: [1e6], }); -function main({ millions }) { - const iterations = millions * 1e6; - +function main({ n }) { const timersList = []; bench.start(); - for (var i = 0; i < iterations; i++) { + for (var i = 0; i < n; i++) { timersList.push(setTimeout(cb, i + 1)); } - bench.end(iterations / 1e6); + bench.end(n); - for (var j = 0; j < iterations + 1; j++) { + for (var j = 0; j < n + 1; j++) { clearTimeout(timersList[j]); } } |