diff options
Diffstat (limited to 'benchmark/dgram/multi-buffer.js')
-rw-r--r-- | benchmark/dgram/multi-buffer.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/benchmark/dgram/multi-buffer.js b/benchmark/dgram/multi-buffer.js index a0285c8c59..15f70760ab 100644 --- a/benchmark/dgram/multi-buffer.js +++ b/benchmark/dgram/multi-buffer.js @@ -7,7 +7,7 @@ const PORT = common.PORT; // `num` is the number of send requests to queue up each time. // Keep it reasonably high (>10) otherwise you're benchmarking the speed of // event loop cycles more than anything else. -var bench = common.createBenchmark(main, { +const bench = common.createBenchmark(main, { len: [64, 256, 1024], num: [100], chunks: [1, 2, 4, 8], @@ -37,12 +37,12 @@ function main(conf) { server(); } -var dgram = require('dgram'); +const dgram = require('dgram'); function server() { var sent = 0; var received = 0; - var socket = dgram.createSocket('udp4'); + const socket = dgram.createSocket('udp4'); function onsend() { if (sent++ % num === 0) { @@ -57,8 +57,8 @@ function server() { onsend(); setTimeout(function() { - var bytes = (type === 'send' ? sent : received) * len; - var gbits = (bytes * 8) / (1024 * 1024 * 1024); + const bytes = (type === 'send' ? sent : received) * len; + const gbits = (bytes * 8) / (1024 * 1024 * 1024); bench.end(gbits); process.exit(0); }, dur * 1000); |