MCPcopy Create free account
hub / github.com/nodejs/node / run

Function run

benchmark/fs/bench-stat-promise.js:11–22  ·  view source on GitHub ↗
(n, statType)

Source from the content-addressed store, hash-verified

9});
10
11async function run(n, statType) {
12 const handleMode = statType === 'fstat';
13 const arg = handleMode ? await fsPromises.open(__filename, 'r') : __filename;
14 let remaining = n;
15 bench.start();
16 while (remaining-- > 0)
17 await (handleMode ? arg.stat() : fsPromises[statType](arg));
18 bench.end(n);
19
20 if (typeof arg.close === 'function')
21 await arg.close();
22}
23
24function main(conf) {
25 const n = conf.n >>> 0;

Callers 1

mainFunction · 0.70

Calls 5

openMethod · 0.65
closeMethod · 0.65
startMethod · 0.45
statMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected