From 998c97c1f47dcfc5ebc93e727ecc0714679ce71d Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Mon, 16 Nov 2020 14:01:32 -0300 Subject: [PATCH] use TKUnit wait --- apps/automated/src/timer/timer-tests.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/automated/src/timer/timer-tests.ts b/apps/automated/src/timer/timer-tests.ts index e24cb5d8c..17ad4e123 100644 --- a/apps/automated/src/timer/timer-tests.ts +++ b/apps/automated/src/timer/timer-tests.ts @@ -174,20 +174,12 @@ export function test_setInterval_callbackCalledWithExtraArgs(done) { export function test_setInterval_callbackNotDelayedByBusyWork() { let calls = 0; - function busyWait(ms: number) { - const waitStart = Date.now(); - while (true) { - if (Date.now() - waitStart >= ms) { - break; - } - } - } let firstCall = true; const id = timer.setInterval(() => { calls++; if (firstCall) { firstCall = false; - busyWait(25); + TKUnit.wait(0.025); } }, 50);