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

Function benchELUSimple

benchmark/perf_hooks/bench-eventlooputil.js:40–51  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

38}
39
40function benchELUSimple(n) {
41 // Need to put this in setImmediate or will always return 0.
42 setImmediate(() => {
43 const elu = eventLoopUtilization();
44 assert(elu.active + elu.idle > 0);
45
46 bench.start();
47 for (let i = 0; i < n; i++)
48 eventLoopUtilization();
49 bench.end(n);
50 });
51}
52
53function benchELUPassed(n) {
54 // Need to put this in setImmediate or will always return 0.

Callers 1

mainFunction · 0.70

Calls 5

setImmediateFunction · 0.50
eventLoopUtilizationFunction · 0.50
assertFunction · 0.50
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected