From ad223362451688c13a4441563210f58bdb046a78 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 17 May 2023 13:59:55 -0600 Subject: feat(ext/web): Request higher-resolution timer on Windows if user requests setTimeout w/short delay (#19149) If a timer is requested with <=100ms resolution, request the high-res timer. Since the default Windows timer period is 15ms, this means a 100ms timer could fire at 115ms (15% late). We assume that timers longer than 100ms are a reasonable cutoff here. The high-res timers on Windows are still limited. Unfortuntely this means that our shortest duration 4ms timers can still be 25% late, but without a more complex timer system or spinning on the clock itself, we're somewhat bounded by the OS' scheduler itself. --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.lock') diff --git a/Cargo.lock b/Cargo.lock index 19821855a..5a1a5c4b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1374,6 +1374,7 @@ dependencies = [ "serde", "tokio", "uuid", + "windows-sys 0.48.0", ] [[package]] -- cgit v1.2.3