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

Function main

benchmark/os/uptime.js:13–38  ·  view source on GitHub ↗
({ n })

Source from the content-addressed store, hash-verified

11});
12
13function main({ n }) {
14 if (os.type() === 'OS400') {
15 console.log('Skipping: os.uptime is not implemented on IBMi');
16 process.exit(0);
17 }
18
19 // Warm up.
20 const length = 1024;
21 const array = [];
22 for (let i = 0; i < length; ++i) {
23 array.push(uptime());
24 }
25
26 bench.start();
27 for (let i = 0; i < n; ++i) {
28 const index = i % length;
29 array[index] = uptime();
30 }
31 bench.end(n);
32
33 // Verify the entries to prevent dead code elimination from making
34 // the benchmark invalid.
35 for (let i = 0; i < length; ++i) {
36 assert.strictEqual(typeof array[i], 'number');
37 }
38}

Callers

nothing calls this directly

Calls 6

typeMethod · 0.45
logMethod · 0.45
exitMethod · 0.45
pushMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…