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

Function main

benchmark/process/bench-hrtime.js:11–40  ·  view source on GitHub ↗
({ n, type })

Source from the content-addressed store, hash-verified

9});
10
11function main({ n, type }) {
12 const hrtime = process.hrtime;
13 let noDead = type === 'bigint' ? hrtime.bigint() : hrtime();
14
15 switch (type) {
16 case 'raw':
17 bench.start();
18 for (let i = 0; i < n; i++) {
19 noDead = hrtime();
20 }
21 bench.end(n);
22 break;
23 case 'diff':
24 bench.start();
25 for (let i = 0; i < n; i++) {
26 noDead = hrtime(noDead);
27 }
28 bench.end(n);
29 break;
30 case 'bigint':
31 bench.start();
32 for (let i = 0; i < n; i++) {
33 noDead = hrtime.bigint();
34 }
35 bench.end(n);
36 break;
37 }
38
39 assert.ok(Array.isArray(noDead) || typeof noDead === 'bigint');
40}

Callers

nothing calls this directly

Calls 4

hrtimeFunction · 0.85
startMethod · 0.45
endMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…