aboutsummaryrefslogtreecommitdiff
path: root/benchmark/timers/timers-insert-unpooled.js
diff options
context:
space:
mode:
authorjuggernaut451 <singhjug1994@gmail.com>2018-03-17 20:49:09 +0530
committerRuben Bridgewater <ruben@bridgewater.de>2018-04-10 00:22:33 +0200
commitb80da63b99dc27fcf9b15b65d7166d427a563b3d (patch)
tree45b2d9bff120f659df4d3a71afb789d3f8a2721a /benchmark/timers/timers-insert-unpooled.js
parent28e5c462d4f65dca3d0153a5df314f0d4c5c4a84 (diff)
downloadandroid-node-v8-b80da63b99dc27fcf9b15b65d7166d427a563b3d.tar.gz
android-node-v8-b80da63b99dc27fcf9b15b65d7166d427a563b3d.tar.bz2
android-node-v8-b80da63b99dc27fcf9b15b65d7166d427a563b3d.zip
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-insert-unpooled.js')
-rw-r--r--benchmark/timers/timers-insert-unpooled.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/benchmark/timers/timers-insert-unpooled.js b/benchmark/timers/timers-insert-unpooled.js
index fbbeebb759..1f1c5155a7 100644
--- a/benchmark/timers/timers-insert-unpooled.js
+++ b/benchmark/timers/timers-insert-unpooled.js
@@ -3,21 +3,19 @@ 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 = [];
bench.start();
- for (var i = 0; i < iterations; i++) {
+ for (var i = 0; i < n; i++) {
timersList.push(setTimeout(cb, i + 1));
}
- bench.end(iterations / 1e6);
+ bench.end(n);
- for (var j = 0; j < iterations + 1; j++) {
+ for (var j = 0; j < n + 1; j++) {
clearTimeout(timersList[j]);
}
}