build(deps-dev): apply updates
[benchmarks-js.git] / busy-wait.mjs
index 2add04648a4190d2f787c1341c1a845475c38bc8..eeef8fed05b791d348218e6d5971dea0da6c64d7 100644 (file)
@@ -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)
   })
@@ -77,6 +77,4 @@ Benchmark.suite(
   Benchmark.save({ file: 'busy-wait', format: 'json', details: true }),
   Benchmark.save({ file: 'busy-wait', format: 'chart.html', details: true }),
   Benchmark.save({ file: 'busy-wait', format: 'table.html', details: true })
-).catch((err) => {
-  console.error(err)
-})
+).catch(console.error)