How does a program know actually what a second is?

613 views

So if a program needs to wait 10 seconds for something, how it is actually calculating it if the processors speed continously changes? (And i’m talking about offline programs that does not use NTP)

In: 361

20 Answers

Anonymous 0 Comments

The same way electric watches do – a crystal oscillator.

When you pass a voltage across the crystal, it vibrates in a very very specific frequency. Millions of times per second, depending on the crystal. The computer passes a tiny charge through the crystal and then counts how many times it vibrates, since it knows how many times it vibrates per second it can tell time.

This is stored in a separate component on the motherboard (generally), known as ‘the clock’. That way all programs have access to the same time measurement.

You are viewing 1 out of 20 answers, click here to view all answers.