From: Jérôme Benoit Date: Mon, 7 Jun 2021 18:18:06 +0000 (+0200) Subject: busy-wait.js: rename a method argument X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e47f67dbe01272e83e27e6eafede736e925266fd;p=benchmarks-js.git busy-wait.js: rename a method argument Signed-off-by: Jérôme Benoit --- diff --git a/busy-wait.js b/busy-wait.js index 9ff5a00..5ea20aa 100644 --- a/busy-wait.js +++ b/busy-wait.js @@ -15,30 +15,30 @@ function dummyTimeoutBusyWait (timeoutMs) { /** * @param timeoutMs - * @param delayMs + * @param intervalMs */ -async function divideAndConquerTimeoutBusyWait (timeoutMs, delayMs = 200) { - const tries = Math.round(timeoutMs / delayMs) +async function divideAndConquerTimeoutBusyWait (timeoutMs, intervalMs = 200) { + const tries = Math.round(timeoutMs / intervalMs) let count = 0 do { count++ - await sleep(delayMs) + await sleep(intervalMs) } while (count <= tries) } /** * @param timeoutMs - * @param delayMs + * @param intervalMs */ -function setIntervalTimeoutBusyWait (timeoutMs, delayMs = 200) { - const tries = Math.round(timeoutMs / delayMs) +function setIntervalTimeoutBusyWait (timeoutMs, intervalMs = 200) { + const tries = Math.round(timeoutMs / intervalMs) let count = 0 const triesSetInterval = setInterval(() => { count++ if (count === tries) { clearInterval(triesSetInterval) } - }, delayMs) + }, intervalMs) } suite