summaryrefslogtreecommitdiff
path: root/benchmark/tls/throughput.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/tls/throughput.js')
-rw-r--r--benchmark/tls/throughput.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/benchmark/tls/throughput.js b/benchmark/tls/throughput.js
index 2b8b2d5376..51feb85cba 100644
--- a/benchmark/tls/throughput.js
+++ b/benchmark/tls/throughput.js
@@ -1,6 +1,6 @@
'use strict';
-var common = require('../common.js');
-var bench = common.createBenchmark(main, {
+const common = require('../common.js');
+const bench = common.createBenchmark(main, {
dur: [5],
type: ['buf', 'asc', 'utf'],
size: [2, 1024, 1024 * 1024]
@@ -9,11 +9,11 @@ var bench = common.createBenchmark(main, {
var dur, type, encoding, size;
var server;
-var path = require('path');
-var fs = require('fs');
-var cert_dir = path.resolve(__dirname, '../../test/fixtures');
+const path = require('path');
+const fs = require('fs');
+const cert_dir = path.resolve(__dirname, '../../test/fixtures');
var options;
-var tls = require('tls');
+const tls = require('tls');
function main(conf) {
dur = +conf.dur;
@@ -48,7 +48,7 @@ function main(conf) {
setTimeout(done, dur * 1000);
var conn;
server.listen(common.PORT, function() {
- var opt = { port: common.PORT, rejectUnauthorized: false };
+ const opt = { port: common.PORT, rejectUnauthorized: false };
conn = tls.connect(opt, function() {
bench.start();
conn.on('drain', write);
@@ -68,7 +68,7 @@ function main(conf) {
}
function done() {
- var mbits = (received * 8) / (1024 * 1024);
+ const mbits = (received * 8) / (1024 * 1024);
bench.end(mbits);
if (conn)
conn.destroy();