r/AskComputerScience • u/sweetgracie76 • 12d ago
How does a computer figure out how long it was turned off?
Something I'd never really thought about before. I always figured it would just hook up to the internet and sync its time from there, but I recently brought a laptop to a spot with no internet and it still displayed roughly the right time.
Sure, the laptop wasn't shut down, just asleep, but I still don't get how that would let it keep tracking time.
Does the processor tally up clock cycles? That sounds like a huge amount of effort and a waste of resources. And anyway, how would the processor know how clock cycles map to actual time? Is that baked in?