summaryrefslogtreecommitdiff
path: root/benchmark/crypto/get-ciphers.js
blob: 5bbe09153114840964b13123539ecd08952ff0d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'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);
}