mirror of
https://github.com/nodejs/node.git
synced 2025-05-22 00:43:56 +00:00

Use `let` in module, napi, net, os, path, process, querystring, streams and string_decoder. PR-URL: https://github.com/nodejs/node/pull/31592 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
22 lines
301 B
JavaScript
22 lines
301 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common.js');
|
|
const bench = common.createBenchmark(main, {
|
|
n: [4e5]
|
|
});
|
|
|
|
function main({ n }) {
|
|
let j = 0;
|
|
|
|
function cb() {
|
|
j++;
|
|
if (j === n)
|
|
bench.end(n);
|
|
}
|
|
|
|
bench.start();
|
|
for (let i = 0; i < n; i++) {
|
|
queueMicrotask(cb);
|
|
}
|
|
}
|