Initial benckmark commit
[benchmarks-js.git] / benchmark-utils.js
CommitLineData
ed2968f2
JB
1function 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
8const LIST_FORMATTER = new Intl.ListFormat('en-US', {
9 style: 'long',
10 type: 'conjunction'
11})
12
13module.exports = { generateRandomInteger, LIST_FORMATTER }