benchmark: use let instead of var in child_process
PR-URL: https://github.com/nodejs/node/pull/31043 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
1bc7a50fdd
commit
3885e157fa
@ -19,7 +19,7 @@ function childProcessExecStdout({ dur, len }) {
|
||||
const cmd = `yes "${'.'.repeat(len)}"`;
|
||||
const child = exec(cmd, { 'stdio': ['ignore', 'pipe', 'ignore'] });
|
||||
|
||||
var bytes = 0;
|
||||
let bytes = 0;
|
||||
child.stdout.on('data', (msg) => {
|
||||
bytes += msg.length;
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ if (process.argv[2] === 'child') {
|
||||
const child = spawn(process.argv[0],
|
||||
[process.argv[1], 'child', len], options);
|
||||
|
||||
var bytes = 0;
|
||||
let bytes = 0;
|
||||
child.on('message', (msg) => { bytes += msg.length; });
|
||||
|
||||
setTimeout(() => {
|
||||
|
@ -24,7 +24,7 @@ function main({ dur, len }) {
|
||||
const options = { 'stdio': ['ignore', 'pipe', 'ignore'] };
|
||||
const child = child_process.spawn('yes', [msg], options);
|
||||
|
||||
var bytes = 0;
|
||||
let bytes = 0;
|
||||
child.stdout.on('data', (msg) => {
|
||||
bytes += msg.length;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user