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

Function main

benchmark/esm/esm-loader-import.js:28–43  ·  view source on GitHub ↗
(conf)

Source from the content-addressed store, hash-verified

26const bench = common.createBenchmark(main, configs, options);
27
28async function main(conf) {
29 tmpdir.refresh();
30
31 fs.mkdirSync(benchmarkDirectory, { recursive: true });
32 fs.writeFileSync(new URL('./relative-existing.js', benchmarkDirectory), '\n');
33
34 bench.start();
35
36 for (let i = 0; i < conf.n; i++) {
37 try {
38 await import(new URL(conf.specifier.replace('{i}', i), benchmarkDirectory));
39 } catch { /* empty */ }
40 }
41
42 bench.end(conf.n);
43}

Callers

nothing calls this directly

Calls 5

refreshMethod · 0.45
mkdirSyncMethod · 0.45
writeFileSyncMethod · 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…