A timer that stays right in the background
Browsers slow down pages you are not looking at. A timer that counts its own ticks drifts when you switch tabs, sometimes by minutes. This one stores the moment it should finish and works backwards from the clock, so switching away changes nothing. The remaining time also shows in the tab title.
The one thing a background tab can delay is the sound. If the alarm matters, keep the tab visible or at least unmuted.