1'use strict'; 2 3const common = require('../common.js'); 4 5const bench = common.createBenchmark(main, { 6 n: [1, 5000], 7 v: ['crypto', 'tls'], 8}); 9 10function main({ n, v }) { 11 const method = require(v).getCiphers; 12 let i = 0; 13 // First call to getCiphers will dominate the results 14 if (n > 1) { 15 for (; i < n; i++) 16 method(); 17 } 18 bench.start(); 19 for (i = 0; i < n; i++) method(); 20 bench.end(n); 21} 22