summaryrefslogtreecommitdiff
path: root/benchmark/timers/timers-cancel-pooled.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/timers/timers-cancel-pooled.js')
-rw-r--r--benchmark/timers/timers-cancel-pooled.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/benchmark/timers/timers-cancel-pooled.js b/benchmark/timers/timers-cancel-pooled.js
index 3e262f820a..6f16f3c91d 100644
--- a/benchmark/timers/timers-cancel-pooled.js
+++ b/benchmark/timers/timers-cancel-pooled.js
@@ -3,14 +3,13 @@ const common = require('../common.js');
const assert = require('assert');
const bench = common.createBenchmark(main, {
- millions: [5],
+ n: [5e6],
});
-function main({ millions }) {
- const iterations = millions * 1e6;
+function main({ n }) {
var timer = setTimeout(() => {}, 1);
- for (var i = 0; i < iterations; i++) {
+ for (var i = 0; i < n; i++) {
setTimeout(cb, 1);
}
var next = timer._idlePrev;
@@ -18,13 +17,13 @@ function main({ millions }) {
bench.start();
- for (var j = 0; j < iterations; j++) {
+ for (var j = 0; j < n; j++) {
timer = next;
next = timer._idlePrev;
clearTimeout(timer);
}
- bench.end(iterations / 1e6);
+ bench.end(n);
}
function cb() {