Problem with timer in JavaScript especially when tab is inactive
问题 I have this timer in ReactJS that uses the computer's clock's time to run, which is supposedly more accurate than incrementing/decrementing the timer by 1 using setInterval with interval of 1 second. However, even when relying on the computer's clock, the timer's time drifts (by comparing it to this clock my app timer drifted 3 seconds in delay after 15 minutes running), and at some point it even stopped completely, while using other tabs in purpose . import React, { useState, useEffect }