There is a chip inside that has a crystal that pulses a certain number of times per second, usually in the millions or billions. That pulsing is connected to an interrupt, which is connected to a counter. When the computer turns on, the crystal starts counting, and it knows how many counts equals 1 second.
In order to store time between power turning on and off, the memory of what time it is needs to be saved. Most computers (motherboards) have a small battery that keeps a circuit on even when the computer is off to keep time.
If there is no saved time, the device can connect to the internet (or another device) and ask “what time is it?” And then keep count from there.
Latest Answers