From 34bd9f318a164d6b2ee949793146b85b3e152d5f Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Wed, 2 May 2018 10:17:23 +0200 Subject: benchmark: track exec time in next-tick-exec The next-tick-exec benchmarks were meant to track nextTick execution time but due to an error, they actually track addition and execution. PR-URL: https://github.com/nodejs/node/pull/20462 Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- benchmark/process/next-tick-exec.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'benchmark/process/next-tick-exec.js') 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(); } -- cgit v1.2.3