diff options
author | juggernaut451 <singhjug1994@gmail.com> | 2018-03-17 20:49:09 +0530 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-04-10 00:22:33 +0200 |
commit | b80da63b99dc27fcf9b15b65d7166d427a563b3d (patch) | |
tree | 45b2d9bff120f659df4d3a71afb789d3f8a2721a /benchmark/timers/timers-timeout-pooled.js | |
parent | 28e5c462d4f65dca3d0153a5df314f0d4c5c4a84 (diff) | |
download | node-new-b80da63b99dc27fcf9b15b65d7166d427a563b3d.tar.gz |
benchmark: changed millions and thousands to n
PR-URL: https://github.com/nodejs/node/pull/18917
Fixes: https://github.com/nodejs/node/issues/18778
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'benchmark/timers/timers-timeout-pooled.js')
-rw-r--r-- | benchmark/timers/timers-timeout-pooled.js | 15 |
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); } |