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

Function main

benchmark/perf_hooks/timerfied.js:22–36  ·  view source on GitHub ↗
({ n, observe })

Source from the content-addressed store, hash-verified

20let _result;
21
22function main({ n, observe }) {
23 const obs = new PerformanceObserver(() => {
24 bench.end(n);
25 });
26 obs.observe({ entryTypes: [observe], buffered: true });
27
28 const timerfied = performance.timerify(randomFn);
29
30 bench.start();
31 for (let i = 0; i < n; i++)
32 _result = timerfied();
33
34 // Avoid V8 deadcode (elimination)
35 assert.ok(_result);
36}

Callers

nothing calls this directly

Calls 4

observeMethod · 0.95
endMethod · 0.45
startMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected