system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does a computer know how long a second is/tell time?
gpt
There is a quartz crystal oscillator inside a timer chip that vibrates at a regular beat -- it needs a battery to run even when the computer is turned off.

The timer can drift,  so every now and again (in the US) the computer will contact the NIST (national institute of standards and technology) internet time service and re-callibrate itself.