[ntp:questions] Re: clock resolutions for different OS
H. Peter Anvin
hpa at zytor.com
Tue Aug 19 21:15:05 UTC 2003
Followup to: <pnv0b.1588$H_1.14565475 at news-text.cableinet.net>
By author: "David J Taylor" <david-taylor at blueyonder.co.uk>
In newsgroup: comp.protocols.time.ntp
>
> "Drk Ryan" <ryandrk at hotmail.com> wrote in message
> news:de98eac0.0308191107.b6e68be at posting.google.com...
> > Since operating systems such as Linux, Solaris, certain versions of
> > Unix, and WinNT all run at 100Hz clock resolution how is it that their
> > timimg suppport varies: FreeBSD handles nanoseconds, Linux handles
> > microseconds and WinNT only ~10 milliseconds?
> >
> > As 1/100Hz = 10ms should they all not return a resolution of 10ms?
>
> 10msec is the granularity with which timer events are called for
> scheduling etc. The number of actual (e.g. 1MHz) clock cycles which must
> be counted for that timer tick to occur can be varied from the nominal
> 10000 value in small amounts (e.g. 9990..10010) to make the time interrupt
> occur at more correct 10msec intervals. The interaction of the OS with
> the timer tick interrupt, and the actual countdown timer will determine
> the precision with which it chooses to report time to its clients.
>
Most CPUs these days have a counter which counts individual core clock
cycles. At least on single-processor systems without aggressive power
management (or where the power management compensates correctly) this
is a very high quality high-precision clock.
Turn off spread-spectrum in your BIOS chipset setup if you can.
-hpa
--
<hpa at transmeta.com> at work, <hpa at zytor.com> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
More information about the questions
mailing list