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

Function main

benchmark/child_process/child-process-read-ipc.js:22–36  ·  view source on GitHub ↗
({ dur, len })

Source from the content-addressed store, hash-verified

20 const spawn = require('child_process').spawn;
21
22 function main({ dur, len }) {
23 bench.start();
24
25 const options = { 'stdio': ['ignore', 1, 2, 'ipc'] };
26 const child = spawn(process.argv[0],
27 [process.argv[1], 'child', len], options);
28
29 let bytes = 0;
30 child.on('message', (msg) => { bytes += msg.length; });
31
32 setTimeout(() => {
33 child.kill();
34 bench.end(bytes);
35 }, dur * 1000);
36 }
37}

Callers

nothing calls this directly

Calls 6

killMethod · 0.80
spawnFunction · 0.50
setTimeoutFunction · 0.50
startMethod · 0.45
onMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…