3 ms·
This is platform-specific, right? Chromium corrects for drift (https://source.chromium.org/chromium/chromium/src/+/main:third_party/WebKit/Source/platform/Timer
by SeanAnderson 2y ago
This is platform-specific, right? Chromium corrects for drift (https://source.chromium.org/chromium/chromium/src/+/main:third_party/WebKit/Source/platform/Timer.cpp;drc=e6d900fb6ed08dbd3a048899f38962ee75f4d8d0;l=162 https://source.chromium.org/chromium/chromium/src/+/main:thi...)
- msoad 2y agoI wish that was true but you can easily see it drifting in Chrome let lastms function tick() { if (lastms === undefined) lastms = new Date().getMilliseconds() else if (lastms !== new Date().getMilliseconds()) throw new Error('Drifted') } setInterval(tick, 1000)
- deleted 2y ago[deleted]
- realharo 2y agoIt's only drift if the error grows over time. You need to look at the sum of the offsets.
- deleted 2y ago[deleted]