/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v22.23.0
benchmark/crypto/randomBytes.js
23 строки
484 B
Lei Shi
benchmark: update iteration and size in benchmark/crypto/randomBytes.js
09 дек 2023, 21:25
Не верифицирован
09 дек 2023, 21:25
e158b11
Код
Авторство
О чём код?
'use strict'; const common = require('../common.js'); const { randomBytes } = require('crypto'); // Add together with imports const assert = require('assert'); let _cryptoResult; const bench = common.createBenchmark(main, { size: [64, 1024, 8 * 1024, 16 * 1024], n: [1e5], }); function main({ n, size }) { bench.start(); for (let i = 0; i < n; ++i) _cryptoResult = randomBytes(size); bench.end(n); // Avoid V8 deadcode (elimination) assert.ok(_cryptoResult); }