0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/benchmark/crypto/get-ciphers.js
Brandon Smith 13340d47fc benchmark,doc,lib,src,test,tools: fix typos
PR-URL: https://github.com/nodejs/node/pull/23302
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-09 16:53:12 +03:00

22 lines
409 B
JavaScript

'use strict';
const common = require('../common.js');
const bench = common.createBenchmark(main, {
n: [1, 5000],
v: ['crypto', 'tls']
});
function main({ n, v }) {
const method = require(v).getCiphers;
var i = 0;
// First call to getCiphers will dominate the results
if (n > 1) {
for (; i < n; i++)
method();
}
bench.start();
for (i = 0; i < n; i++) method();
bench.end(n);
}