KernelNewbies:

This page aims at being a one-stop-shop for all things related to timekeeping in Linux, in relevant past versions and present ones. I don't have a lot of time to dedicate to it, but since I've been working on a few timekeeping and random drift related issues, I might as well be able to paste some things here.

What is time anyway?

OK, so that's a bit offtopic, since this is not a physics site. But some considerations about time should help us understand the rest of the page. We can say time is a perception of change. If there is no change in state, there is no time. We can also argue that there is also no perception and thus possibly no reality, but that's getting way offtopic. So things change, and we can relate the rate with which some things change to the rate with which other things change, and then we can come up with concepts such as fast or slow. But we do not have a natural unit of time. We can only elect something that changes with a fairly good stability, and use that as a standard.

So by electing something as a standard "event generator", we can count those events and relate other things to specific counts of those events, and we'll have a timeline upon which those other things happened. We'll establish an order upon which the things happened.

This section will surely be updated and corrected ad nauseam. :)

How can we measure time?

The modern concept of a clock is that of a device constituted by three things:

So we can see that time is itself a fairly relative and subjective thing, and measuring time is not different. In order for time scales to be useful, they have to relate to other time scales or external, universally perceived events. If I tell you that my clock now marks 873263652 time units, how good is that, if you don't know the frequency of my clock or the origin of its scale?

So let's say we count seconds. But what is a second? A second is itself another count of another oscillator. The definition of a second is: "The second is the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium 133 atom.". So if we say we count seconds since the latest equinox or full moon, we now have something everyone can make use of.

Things that affect time measurement

TBW.

How does Linux measure time?

To Be Written.

How is time kept "correct" in Linux?

TBW.

Things that can de-stabilize the clock

TBW.

Reference material

http://en.wikipedia.org/wiki/Time

http://rfc.net/rfc1305.html

KernelNewbies: LinuxTimekeeping (last edited 2017-12-30 01:30:12 by localhost)