Why 40 minutes
Forty minutes is a standard secondary-school lesson in much of the world, and a common length for a spin or conditioning class. It is also about the length of one full ultradian cycle of focused attention for many people before concentration measurably degrades.
It will not drift while you do something else
The countdown is worked out from a fixed end time rather than counted down frame by frame, so putting the tab in the background, locking your phone, or switching apps does not cost you any of the 40 minutes. Browsers throttle background JavaScript to save battery, and that is exactly what makes most browser timers lose time. Press start, go and do the thing you are timing.