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