1'use strict'; 2 3const common = require('../common.js'); 4const bench = common.createBenchmark(main, { 5 n: [4e5] 6}); 7 8function main({ n }) { 9 let j = 0; 10 11 function cb() { 12 j++; 13 if (j === n) 14 bench.end(n); 15 } 16 17 bench.start(); 18 for (let i = 0; i < n; i++) { 19 queueMicrotask(cb); 20 } 21} 22