Skip to content
Permalink
Browse files

benchmark: use let instead of var in child_process

PR-URL: #31043
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
dnlup authored and BridgeAR committed Dec 20, 2019
1 parent 048b7f4 commit ca53f02767e569095b9540c531d983719a9675c5
@@ -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;
});

0 comments on commit ca53f02

Please sign in to comment.
You can’t perform that action at this time.