Yes. Instead of adding up seconds on every tick, the timer stores the exact millisecond instant the countdown should end and recomputes the remaining time from the real clock whenever the page runs again. Switching tabs, minimizing the window, or the browser throttling setInterval to save battery never throws off the final result.