refactor: cleanup promise implementation
[benchmarks-js.git] / busy-wait.mjs
index 578e90c06228df105853fb0623f4a5e72e236f0e..5a55ef82ef85164839bc476d84c631b4f03eb720 100644 (file)
@@ -45,14 +45,14 @@ async function divideAndConquerTimeoutBusyWait (
  * @param intervalMs
  */
 async function setIntervalTimeoutBusyWait (timeoutMs, intervalMs = interval) {
-  return await 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)
   })