diff options
Diffstat (limited to 'benchmark/timers/timers-depth.js')
-rw-r--r-- | benchmark/timers/timers-depth.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/benchmark/timers/timers-depth.js b/benchmark/timers/timers-depth.js index ca74eee393..bfc6dd02cf 100644 --- a/benchmark/timers/timers-depth.js +++ b/benchmark/timers/timers-depth.js @@ -2,18 +2,17 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - thousands: [1], + n: [1e3], }); -function main({ thousands }) { - const N = thousands * 1e3; - var n = 0; +function main({ n }) { + var i = 0; bench.start(); setTimeout(cb, 1); function cb() { - n++; - if (n === N) - bench.end(N / 1e3); + i++; + if (i === n) + bench.end(n); else setTimeout(cb, 1); } |