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