# A countdown that stays accurate in a background tab

DevFeed: [A countdown that stays accurate in a background tab](<https://devfeed.tech/articles/a-countdown-that-stays-accurate-in-a-background-tab-9019.md>)

Original publisher: [Read original article](<https://markodenic.tech/a-countdown-that-stays-accurate-in-a-background-tab/>)

Author: Marko

Published: 2026-09-05T06:30:19Z

Content type: tutorial

Language: en

Sources: [Marko Denic Tech](<https://devfeed.tech/sources/marko-denic-tech.md>)

Topics: [web applications](<https://devfeed.tech/topics/web-applications.md>), [client](<https://devfeed.tech/topics/client.md>), [Server](<https://devfeed.tech/topics/server.md>)

Tags: [blog-for-developers](<https://devfeed.tech/tags/blog-for-developers.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [bug](<https://devfeed.tech/tags/bug.md>), [build-faster](<https://devfeed.tech/tags/build-faster.md>), [code-productivity](<https://devfeed.tech/tags/code-productivity.md>), [code-smarter](<https://devfeed.tech/tags/code-smarter.md>), [content-monetization](<https://devfeed.tech/tags/content-monetization.md>), [css-animation](<https://devfeed.tech/tags/css-animation.md>), [css-performance](<https://devfeed.tech/tags/css-performance.md>), [developer-growth](<https://devfeed.tech/tags/developer-growth.md>), [developer-resources](<https://devfeed.tech/tags/developer-resources.md>), [email-newsletter-for-coders](<https://devfeed.tech/tags/email-newsletter-for-coders.md>), [front-end-development](<https://devfeed.tech/tags/front-end-development.md>), [github-profile-automation](<https://devfeed.tech/tags/github-profile-automation.md>), [html](<https://devfeed.tech/tags/html.md>), [html-tips](<https://devfeed.tech/tags/html-tips.md>), [http](<https://devfeed.tech/tags/http.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [javascript-tricks](<https://devfeed.tech/tags/javascript-tricks.md>), [learn-to-code](<https://devfeed.tech/tags/learn-to-code.md>), [responsive-design-tips](<https://devfeed.tech/tags/responsive-design-tips.md>), [server](<https://devfeed.tech/tags/server.md>), [ui](<https://devfeed.tech/tags/ui.md>), [web-dev-newsletter](<https://devfeed.tech/tags/web-dev-newsletter.md>), [web-development](<https://devfeed.tech/tags/web-development.md>), [web-development-tips](<https://devfeed.tech/tags/web-development-tips.md>), [weekly-dev-tips](<https://devfeed.tech/tags/weekly-dev-tips.md>), [workflow-optimization](<https://devfeed.tech/tags/workflow-optimization.md>)

## AI overview

A tutorial on building accurate web countdowns despite background-tab timer throttling. It recommends calculating remaining time from an absolute deadline, forcing a render when a tab returns, and treating the server clock as the authority for consequential expirations.

## Source excerpt

Your checkout timer says 4:55 when the cart already expired. Why background tabs break setInterval countdowns, and the three-line fix.