build(deps-dev): Bump @commitlint/config-conventional
[benchmarks-js.git] / busy-wait.mjs
index a785a7e8247a3eb4b07acf3f68ec5716eb6b6ea7..5a55ef82ef85164839bc476d84c631b4f03eb720 100644 (file)
@@ -1,5 +1,5 @@
 import Benchmark from 'benny'
-import { sleep } from './benchmark-utils.js'
+import { sleep } from './benchmark-utils.mjs'
 
 const timeout = 2000
 const interval = 1000
@@ -45,14 +45,14 @@ async function divideAndConquerTimeoutBusyWait (
  * @param intervalMs
  */
 async function setIntervalTimeoutBusyWait (timeoutMs, intervalMs = interval) {
-  return new Promise(resolve => {
+  await new Promise(resolve => {
     const tries = Math.round(timeoutMs / intervalMs)
     let count = 0
     const triesSetInterval = setInterval(() => {
       count++
       if (count === tries) {
         clearInterval(triesSetInterval)
-        return resolve()
+        resolve()
       }
     }, intervalMs)
   })