Add more benchmarks
[benchmarks-js.git] / benchmark-utils.js
index c1b68c581615b842ec7804111f71aafbf7f8c279..4de6ea7728d45765c65573991495c9fb3979f374 100644 (file)
@@ -9,9 +9,16 @@ function generateRandomInteger (max, min = 0) {
   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'
 })
 
-module.exports = { generateRandomInteger, LIST_FORMATTER }
+module.exports = { generateRandomInteger, sleep, LIST_FORMATTER }