summaryrefslogtreecommitdiff
path: root/benchmark/timers/timers-timeout-pooled.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/timers/timers-timeout-pooled.js')
-rw-r--r--benchmark/timers/timers-timeout-pooled.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/benchmark/timers/timers-timeout-pooled.js b/benchmark/timers/timers-timeout-pooled.js
index df88e2784f..d34080fa66 100644
--- a/benchmark/timers/timers-timeout-pooled.js
+++ b/benchmark/timers/timers-timeout-pooled.js
@@ -5,11 +5,10 @@ const common = require('../common.js');
// which then get executed on the next uv tick
const bench = common.createBenchmark(main, {
- millions: [10],
+ n: [1e7],
});
-function main({ millions }) {
- const iterations = millions * 1e6;
+function main({ n }) {
let count = 0;
// Function tracking on the hidden class in V8 can cause misleading
@@ -18,16 +17,16 @@ function main({ millions }) {
function cb() {
count++;
- if (count === iterations)
- bench.end(iterations / 1e6);
+ if (count === n)
+ bench.end(n);
}
function cb2() {
count++;
- if (count === iterations)
- bench.end(iterations / 1e6);
+ if (count === n)
+ bench.end(n);
}
- for (var i = 0; i < iterations; i++) {
+ for (var i = 0; i < n; i++) {
setTimeout(i % 2 ? cb : cb2, 1);
}