Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-01-23 15:19:30 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-01 12:49:04 +0300
commit1b6cb947611de5865641d1a6780ee6930a4e1d69 (patch)
tree279384c2b3bde394f8a8b3f543fdc0725ef1b93f /benchmark/dgram
parentc713f079f1bd1c575487c693f3f9244bed460ee1 (diff)
benchmark: refactor
PR-URL: https://github.com/nodejs/node/pull/18320 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/dgram')
-rw-r--r--benchmark/dgram/bind-params.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/benchmark/dgram/bind-params.js b/benchmark/dgram/bind-params.js
index 5f7999f7a39..ea1f430eed9 100644
--- a/benchmark/dgram/bind-params.js
+++ b/benchmark/dgram/bind-params.js
@@ -15,10 +15,11 @@ const noop = () => {};
function main({ n, port, address }) {
port = port === 'true' ? 0 : undefined;
address = address === 'true' ? '0.0.0.0' : undefined;
+ var i;
if (port !== undefined && address !== undefined) {
bench.start();
- for (let i = 0; i < n; i++) {
+ for (i = 0; i < n; i++) {
dgram.createSocket('udp4').bind(port, address)
.on('error', noop)
.unref();
@@ -26,7 +27,7 @@ function main({ n, port, address }) {
bench.end(n);
} else if (port !== undefined) {
bench.start();
- for (let i = 0; i < n; i++) {
+ for (i = 0; i < n; i++) {
dgram.createSocket('udp4')
.bind(port)
.on('error', noop)
@@ -35,7 +36,7 @@ function main({ n, port, address }) {
bench.end(n);
} else if (port === undefined && address === undefined) {
bench.start();
- for (let i = 0; i < n; i++) {
+ for (i = 0; i < n; i++) {
dgram.createSocket('udp4')
.bind()
.on('error', noop)