mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
1b16bf6561
Fixes: https://github.com/nodejs/node/issues/50571 PR-URL: https://github.com/nodejs/node/pull/50863 Refs: https://github.com/nodejs/node/issues/50571 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
22 lines
412 B
JavaScript
22 lines
412 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common.js');
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
n: [1, 500000],
|
|
v: ['crypto', 'tls'],
|
|
});
|
|
|
|
function main({ n, v }) {
|
|
const method = require(v).getCiphers;
|
|
let 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);
|
|
}
|