How does a program know actually what a second is?

593 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

Well, sort of have to tell it what a second is. Most systems have some sort of fixed-frequency side circuit that always runs at that frequency as long as it is provided energy. The computer can count the signal and declare passage of time (some number of vibrations that we tell it equals one second).

There are multiple ways to filter the signal to a fixed frequency, but a cheap and common one has always been quartz crystals due to the piezoelectric effect. They vibrate at a fixed frequency when zapped with a current (they can also make current if squeezed or deformed, but that is not what they are usually used for, although it seems to explain electrical phenomena associated with some earthquakes).

Squish a quartz crystal in the right way and electrons run away. lots of deformation and lots of quartz can make quite a bit of electrons move. Zap it with current and it vibrates at a specific frequency. A very good timekeeper as long as you provide the current.

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