diff options
Diffstat (limited to 'benchmark/child_process')
-rw-r--r-- | benchmark/child_process/child-process-read-ipc.js | 8 | ||||
-rw-r--r-- | benchmark/child_process/child-process-read.js | 4 | ||||
-rw-r--r-- | benchmark/child_process/spawn-echo.js | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/benchmark/child_process/child-process-read-ipc.js b/benchmark/child_process/child-process-read-ipc.js index 3971eb8b396..a9e9cdf7fd7 100644 --- a/benchmark/child_process/child-process-read-ipc.js +++ b/benchmark/child_process/child-process-read-ipc.js @@ -13,7 +13,7 @@ if (process.argv[2] === 'child') { const bench = common.createBenchmark(main, { len: [ 64, 256, 1024, 4096, 16384, 65536, - 65536 << 4, 65536 << 8 + 65536 << 4, 65536 << 8, ], dur: [5] }); @@ -27,11 +27,9 @@ if (process.argv[2] === 'child') { [process.argv[1], 'child', len], options); var bytes = 0; - child.on('message', function(msg) { - bytes += msg.length; - }); + child.on('message', (msg) => { bytes += msg.length; }); - setTimeout(function() { + setTimeout(() => { child.kill(); bench.end(bytes); }, dur * 1000); diff --git a/benchmark/child_process/child-process-read.js b/benchmark/child_process/child-process-read.js index 0ff08af7948..3c0144116f5 100644 --- a/benchmark/child_process/child-process-read.js +++ b/benchmark/child_process/child-process-read.js @@ -25,11 +25,11 @@ function main({ dur, len }) { const child = child_process.spawn('yes', [msg], options); var bytes = 0; - child.stdout.on('data', function(msg) { + child.stdout.on('data', (msg) => { bytes += msg.length; }); - setTimeout(function() { + setTimeout(() => { if (process.platform === 'win32') { // Sometimes there's a yes.exe process left hanging around on Windows... child_process.execSync(`taskkill /f /t /pid ${child.pid}`); diff --git a/benchmark/child_process/spawn-echo.js b/benchmark/child_process/spawn-echo.js index 62f46fb4c0e..8f5c80cd23b 100644 --- a/benchmark/child_process/spawn-echo.js +++ b/benchmark/child_process/spawn-echo.js @@ -15,7 +15,7 @@ function go(n, left) { return bench.end(n); const child = spawn('echo', ['hello']); - child.on('exit', function(code) { + child.on('exit', (code) => { if (code) process.exit(code); else |