build(deps-dev): apply updates
[benchmarks-js.git] / busy-wait.mjs
index 578e90c06228df105853fb0623f4a5e72e236f0e..e5aaaeaa91a30b8bd2989ed665035a6d8b3a6e1c 100644 (file)
@@ -1,4 +1,5 @@
 import Benchmark from 'benny'
+
 import { sleep } from './benchmark-utils.mjs'
 
 const timeout = 2000
@@ -45,14 +46,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)
   })
@@ -77,6 +78,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)