MCPcopy Index your code
hub / github.com/nodejs/node / benchELUPassed

Function benchELUPassed

benchmark/worker/bench-eventlooputil.js:43–54  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

41}
42
43function benchELUPassed(n) {
44 const worker = new Worker(__filename, { argv: ['idle cats'] });
45
46 spinUntilIdle(worker, () => {
47 let elu = worker.performance.eventLoopUtilization();
48 bench.start();
49 for (let i = 0; i < n; i++)
50 elu = worker.performance.eventLoopUtilization(elu);
51 bench.end(n);
52 worker.postMessage('bye');
53 });
54}
55
56function spinUntilIdle(w, cb) {
57 const t = w.performance.eventLoopUtilization();

Callers 1

mainFunction · 0.70

Calls 4

postMessageMethod · 0.95
spinUntilIdleFunction · 0.85
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…