mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00: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>
22 lines
304 B
JavaScript
22 lines
304 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common.js');
|
|
const bench = common.createBenchmark(main, {
|
|
n: [1e7],
|
|
});
|
|
|
|
function main({ n }) {
|
|
let j = 0;
|
|
|
|
function cb() {
|
|
j++;
|
|
if (j === n)
|
|
bench.end(n);
|
|
}
|
|
|
|
bench.start();
|
|
for (let i = 0; i < n; i++) {
|
|
process.nextTick(cb);
|
|
}
|
|
}
|