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

Function main

benchmark/crypto/randomInt.js:13–38  ·  view source on GitHub ↗
({ mode, min, max, n })

Source from the content-addressed store, hash-verified

11});
12
13function main({ mode, min, max, n }) {
14 if (mode === 'sync') {
15 bench.start();
16 for (let i = 0; i < n; i++)
17 randomInt(min, max);
18 bench.end(n);
19 } else if (mode === 'async-sequential') {
20 bench.start();
21 (function next(i) {
22 if (i === n)
23 return bench.end(n);
24 randomInt(min, max, () => {
25 next(i + 1);
26 });
27 })(0);
28 } else {
29 bench.start();
30 let done = 0;
31 for (let i = 0; i < n; i++) {
32 randomInt(min, max, () => {
33 if (++done === n)
34 bench.end(n);
35 });
36 }
37 }
38}

Callers

nothing calls this directly

Calls 4

randomIntFunction · 0.85
nextFunction · 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…