diff options
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/process/next-tick-exec-args.js | 11 | ||||
-rw-r--r-- | benchmark/process/next-tick-exec.js | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/benchmark/process/next-tick-exec-args.js b/benchmark/process/next-tick-exec-args.js index 3be86cc08e..f5d0fb9422 100644 --- a/benchmark/process/next-tick-exec-args.js +++ b/benchmark/process/next-tick-exec-args.js @@ -5,8 +5,11 @@ const bench = common.createBenchmark(main, { }); function main({ n }) { + function onNextTick(i) { + if (i + 1 === n) + bench.end(n); + } - bench.start(); for (var i = 0; i < n; i++) { if (i % 4 === 0) process.nextTick(onNextTick, i, true, 10, 'test'); @@ -17,8 +20,6 @@ function main({ n }) { else process.nextTick(onNextTick, i); } - function onNextTick(i) { - if (i + 1 === n) - bench.end(n); - } + + bench.start(); } diff --git a/benchmark/process/next-tick-exec.js b/benchmark/process/next-tick-exec.js index d00ee017de..936b253bfa 100644 --- a/benchmark/process/next-tick-exec.js +++ b/benchmark/process/next-tick-exec.js @@ -5,13 +5,14 @@ const bench = common.createBenchmark(main, { }); function main({ n }) { - - bench.start(); - for (var i = 0; i < n; i++) { - process.nextTick(onNextTick, i); - } function onNextTick(i) { if (i + 1 === n) bench.end(n); } + + for (var i = 0; i < n; i++) { + process.nextTick(onNextTick, i); + } + + bench.start(); } |