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

Function main

benchmark/os/tmpdir.js:11–31  ·  view source on GitHub ↗
({ n })

Source from the content-addressed store, hash-verified

9});
10
11function main({ n }) {
12 // Warm up.
13 const length = 1024;
14 const array = [];
15 for (let i = 0; i < length; ++i) {
16 array.push(tmpdir());
17 }
18
19 bench.start();
20 for (let i = 0; i < n; ++i) {
21 const index = i % length;
22 array[index] = tmpdir();
23 }
24 bench.end(n);
25
26 // Verify the entries to prevent dead code elimination from making
27 // the benchmark invalid.
28 for (let i = 0; i < length; ++i) {
29 assert.strictEqual(typeof array[i], 'string');
30 }
31}

Callers

nothing calls this directly

Calls 4

tmpdirFunction · 0.85
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…