MCPcopy Create free account
hub / github.com/nodejs/node / main

Function main

benchmark/perf_hooks/performance-observer.js:32–49  ·  view source on GitHub ↗
({ n, pending })

Source from the content-addressed store, hash-verified

30}
31
32function main({ n, pending }) {
33 const timerfied = performance.timerify(randomFn);
34
35 let count = 0;
36 const obs = new PerformanceObserver((entries) => {
37 count += entries.getEntries().length;
38
39 if (count >= n) {
40 bench.end(count);
41 } else {
42 fillQueue(timerfied, pending);
43 }
44 });
45 obs.observe({ entryTypes: ['function'], buffered: true });
46
47 bench.start();
48 fillQueue(timerfied, pending);
49}

Callers

nothing calls this directly

Calls 5

observeMethod · 0.95
fillQueueFunction · 0.85
getEntriesMethod · 0.45
endMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected