Precision Browser Timekeeping
When executing clocks in a web browser, standard code functions like setInterval(..., 10) are incredibly unstable. Due to the single-threaded nature of JavaScript, if you scroll the page or open another tab, the browser throttles these loops, and your stopwatch will mathematically drift backward.
How We Prevent Drift
Both the Stopwatch and Timer tools provided here calculate differences via hardware timestamps (using performance.now() or Date.now()). Rather than counting "+1" every second, we bind a starting timestamp in memory and continuously measure the physical distance between that constant anchor and the present moment. This ensures extreme accuracy even if the browser goes to sleep.
Foreground execution
Please note: While the mathematical tracking continues precisely in the background, modern browsers (Chrome, Safari, Firefox) aggressively throttle background javascript to save battery. If you leave the timer and switch to another tab for an extended period, the visual UI will catch up when you return, however, the audio notification alarm may be delayed by the browser until you focus the tab again.