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

Function main

benchmark/fs/bench-accessSync.js:37–68  ·  view source on GitHub ↗
({ n, type, method })

Source from the content-addressed store, hash-verified

35}
36
37function main({ n, type, method }) {
38 let path;
39
40 switch (type) {
41 case 'existing':
42 path = __filename;
43 break;
44 case 'non-flat-existing':
45 path = tmpfile;
46 break;
47 case 'non-existing':
48 path = tmpdir.resolve(`.non-existing-file-${process.pid}`);
49 break;
50 default:
51 new Error('Invalid type');
52 }
53
54 if (method === 'access') {
55 // Warmup the filesystem - it doesn't need to use the async method
56 runBench(n, path);
57
58 bench.start();
59 runAsyncBench(n, path);
60 } else {
61 // warmup
62 runBench(n, path);
63
64 bench.start();
65 runBench(n, path);
66 bench.end(n);
67 }
68}

Callers

nothing calls this directly

Calls 5

runAsyncBenchFunction · 0.85
runBenchFunction · 0.70
resolveMethod · 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…