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

Function main

benchmark/perf_hooks/usertiming.js:21–34  ·  view source on GitHub ↗
({ n, observe })

Source from the content-addressed store, hash-verified

19}
20
21function main({ n, observe }) {
22 const entryTypes = observe === 'all' ?
23 [ 'mark', 'measure' ] :
24 [ observe ];
25 const obs = new PerformanceObserver(() => {
26 bench.end(n);
27 });
28 obs.observe({ entryTypes, buffered: true });
29
30 bench.start();
31 performance.mark('start');
32 for (let i = 0; i < 1e5; i++)
33 test();
34}

Callers

nothing calls this directly

Calls 5

observeMethod · 0.95
testFunction · 0.70
endMethod · 0.45
startMethod · 0.45
markMethod · 0.45

Tested by

no test coverage detected