• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common.js');
4const { randomUUID } = require('crypto');
5
6const bench = common.createBenchmark(main, {
7  n: [1e7],
8  disableEntropyCache: [0, 1],
9});
10
11function main({ n, disableEntropyCache }) {
12  disableEntropyCache = !!disableEntropyCache;
13  bench.start();
14  for (let i = 0; i < n; ++i)
15    randomUUID({ disableEntropyCache });
16  bench.end(n);
17}
18