summaryrefslogtreecommitdiff
path: root/benchmark/timers/timers-cancel-unpooled.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/timers/timers-cancel-unpooled.js')
-rw-r--r--benchmark/timers/timers-cancel-unpooled.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/benchmark/timers/timers-cancel-unpooled.js b/benchmark/timers/timers-cancel-unpooled.js
index 1586673113..7b46bad719 100644
--- a/benchmark/timers/timers-cancel-unpooled.js
+++ b/benchmark/timers/timers-cancel-unpooled.js
@@ -3,22 +3,21 @@ 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 = [];
- for (var i = 0; i < iterations; i++) {
+ for (var i = 0; i < n; i++) {
timersList.push(setTimeout(cb, i + 1));
}
bench.start();
- for (var j = 0; j < iterations + 1; j++) {
+ for (var j = 0; j < n + 1; j++) {
clearTimeout(timersList[j]);
}
- bench.end(iterations / 1e6);
+ bench.end(n);
}
function cb() {