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

Function main

benchmark/esm/import-esm-reload.js:26–37  ·  view source on GitHub ↗
({ n, count })

Source from the content-addressed store, hash-verified

24}
25
26async function main({ n, count }) {
27 const script = prepare(count);
28 const url = pathToFileURL(script).href;
29 let result = 0;
30 bench.start();
31 for (let i = 0; i < n; i++) {
32 const mod = await import(`${url}?t=${i}`);
33 result += mod[`value${count - 1}`];
34 }
35 bench.end(n);
36 assert.strictEqual(result, n);
37}

Callers

nothing calls this directly

Calls 4

prepareFunction · 0.70
pathToFileURLFunction · 0.50
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…