diff options
author | Rich Trott <rtrott@gmail.com> | 2019-02-04 22:06:08 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-02-06 22:18:31 -0800 |
commit | 29e74d4952b772f7f1bf51e1a8f1665bbbde39d1 (patch) | |
tree | 211a7131ae8f0fa7d8d5f65422cd53ad0741de33 /benchmark/child_process/child-process-read-ipc.js | |
parent | d310d8df62f9c05d07e68c4177f225e9dda72271 (diff) | |
download | android-node-v8-29e74d4952b772f7f1bf51e1a8f1665bbbde39d1.tar.gz android-node-v8-29e74d4952b772f7f1bf51e1a8f1665bbbde39d1.tar.bz2 android-node-v8-29e74d4952b772f7f1bf51e1a8f1665bbbde39d1.zip |
benchmark: refactor for consistent style
Code in benchmark directory sometimes uses `function () {}` for
anonymous callbacks and sometimes uses `() => {}`. Multi-line arrays
sometimes have a trailing comma and sometimes do not. Update to always
use arrow functions for anonymous callbacks and trailing commas for
multiline arrays.
PR-URL: https://github.com/nodejs/node/pull/25944
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/child_process/child-process-read-ipc.js')
-rw-r--r-- | benchmark/child_process/child-process-read-ipc.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/benchmark/child_process/child-process-read-ipc.js b/benchmark/child_process/child-process-read-ipc.js index 3971eb8b39..a9e9cdf7fd 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); |