[ntp:questions] Re: clock resolutions for different OS

David Schwartz davids at webmaster.com
Thu Aug 28 09:26:56 UTC 2003


"Drk Ryan" <ryandrk at hotmail.com> wrote in message
news:de98eac0.0308271119.a8dc11 at posting.google.com...

> I can find in the MSDN documentation where the 10ms figure for WinNT
> is stated.
> But if I want to see where it is documented that a stock FreeBSD
> kernel handles nanoseconds while Linux handles microseconds where do I
> look to find these values? The microtime page of the freeBSD manual
> contains no actual values.

    UTSL.

    FreeBSD internally gets the time from functions called 'nanotime' and
'microtime' depending upon the precision needed. The 'nanotime' function
calls 'tco_delta' which calls 'tc_get_timecount' which maps to
'tsc_get_timecount' if a TSC is available. The 'tsc_get_timecount' function
calls 'rdtsc'.

    Linux  is more straightforward, with functions like
'do_fast_gettimeoffset' which read the TSC, lookup the TSC value and time at
the last timer interrupt, divide by the TSC frequency and add.

    DS





More information about the questions mailing list