It appears when you minimize a window or swap tabs, JavaScript's setInterval()
method starts becoming incredibly unreliable.
I just finished working on a time tracking feature on an app I'm working on, which is driven by setInterval
. This all worked perfectly until I started minimizing the window and coming back to it later, only to find out that the time had increased a small fraction of what it does when the window is up on the screen.
This seems to be a browser level "feature".
Is there an easy alternative I can swap this out for where units of time are actually honoured?