X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=busy-wait.mjs;h=2add04648a4190d2f787c1341c1a845475c38bc8;hb=dfdb4c56e278b8725d5ea689ba571411ce0afd00;hp=a785a7e8247a3eb4b07acf3f68ec5716eb6b6ea7;hpb=f522d7b906f8a45a7e4fd349abe3f83bf8fc3d69;p=benchmarks-js.git diff --git a/busy-wait.mjs b/busy-wait.mjs index a785a7e..2add046 100644 --- a/busy-wait.mjs +++ b/busy-wait.mjs @@ -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,7 +45,7 @@ async function divideAndConquerTimeoutBusyWait ( * @param intervalMs */ async function setIntervalTimeoutBusyWait (timeoutMs, intervalMs = interval) { - return new Promise(resolve => { + return new Promise((resolve) => { const tries = Math.round(timeoutMs / intervalMs) let count = 0 const triesSetInterval = setInterval(() => { @@ -77,6 +77,6 @@ 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 => { +).catch((err) => { console.error(err) })