/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v20.20.2
benchmark/crypto/randomUUID.js
17 строк
388 B
James M Snell
crypto: implement randomuuid
07 янв 2021, 23:44
07 янв 2021, 23:44
0008a67
Код
Авторство
О чём код?
'use strict'; const common = require('../common.js'); const { randomUUID } = require('crypto'); const bench = common.createBenchmark(main, { n: [1e7], disableEntropyCache: [0, 1], }); function main({ n, disableEntropyCache }) { disableEntropyCache = !!disableEntropyCache; bench.start(); for (let i = 0; i < n; ++i) randomUUID({ disableEntropyCache }); bench.end(n); }