mirror of
https://github.com/nodejs/node.git
synced 2024-11-22 07:37:56 +01:00
f466fe5ecc
PR-URL: https://github.com/nodejs/node/pull/46481 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
18 lines
323 B
JavaScript
18 lines
323 B
JavaScript
'use strict';
|
|
const common = require('../common.js');
|
|
const bench = common.createBenchmark(main, {
|
|
n: [7e6],
|
|
});
|
|
|
|
function main({ n }) {
|
|
let counter = n;
|
|
bench.start();
|
|
process.nextTick(onNextTick);
|
|
function onNextTick() {
|
|
if (--counter)
|
|
process.nextTick(onNextTick);
|
|
else
|
|
bench.end(n);
|
|
}
|
|
}
|