From 736b91edd002ae34082c473b37249f9256a6ba32 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Fri, 1 Mar 2024 11:15:18 -0700 Subject: perf(cli): use new deno_core timers (#22569) Improves #19100 Fixes #20356 Replaces #20428 Changes made in deno_core to support this: - [x] Errors must be handled in setTimeout callbacks - [x] Microtask ordering is not-quite-right - [x] Timer cancellation must be checked right before dispatch - [x] Timer sanitizer - [x] Move high-res timer to deno_core - [x] Timers need opcall tracing --- tests/unit/timers_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/timers_test.ts b/tests/unit/timers_test.ts index 17b137231..9e3b082dd 100644 --- a/tests/unit/timers_test.ts +++ b/tests/unit/timers_test.ts @@ -238,8 +238,8 @@ Deno.test(async function callbackTakesLongerThanInterval() { Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 300); timeEndOfFirstCallback = Date.now(); } else { - // Second callback - assert(Date.now() - 100 >= timeEndOfFirstCallback); + // Second callback should be nearly instantaneous + assert(Date.now() - timeEndOfFirstCallback < 10); clearInterval(interval); resolve(); } -- cgit v1.2.3