repositories
/
benchmarks-js.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add more benchmarks
[benchmarks-js.git]
/
benchmark-utils.js
diff --git
a/benchmark-utils.js
b/benchmark-utils.js
index c1b68c581615b842ec7804111f71aafbf7f8c279..4de6ea7728d45765c65573991495c9fb3979f374 100644
(file)
--- a/
benchmark-utils.js
+++ b/
benchmark-utils.js
@@
-9,9
+9,16
@@
function generateRandomInteger (max, min = 0) {
return Math.floor(Math.random() * max + 1)
}
return Math.floor(Math.random() * max + 1)
}
+/**
+ * @param ms
+ */
+async function sleep (ms) {
+ return new Promise(resolve => setTimeout(resolve, ms))
+}
+
const LIST_FORMATTER = new Intl.ListFormat('en-US', {
style: 'long',
type: 'conjunction'
})
const LIST_FORMATTER = new Intl.ListFormat('en-US', {
style: 'long',
type: 'conjunction'
})
-module.exports = { generateRandomInteger, LIST_FORMATTER }
+module.exports = { generateRandomInteger,
sleep,
LIST_FORMATTER }