Initial benckmark commit
[benchmarks-js.git] / benchmark-utils.js
1 function generateRandomInteger (max, min = 0) {
2 if (min) {
3 return Math.floor(Math.random() * (max - min + 1) + min)
4 }
5 return Math.floor(Math.random() * max + 1)
6 }
7
8 const LIST_FORMATTER = new Intl.ListFormat('en-US', {
9 style: 'long',
10 type: 'conjunction'
11 })
12
13 module.exports = { generateRandomInteger, LIST_FORMATTER }