Subject: Re: microtime
To: David Laight <david@l8s.co.uk>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 08/21/2002 15:46:16
In message <20020821234620.J671@snowdrop.l8s.co.uk>David Laight writes
>On Wed, Aug 21, 2002 at 06:08:04AM -0700, Erik E. Fair wrote:


>Unfortunately very few of the interfaces are completely clear
>as to what is required. 

In part, possibly because those interfaces predate the existence of
time-vultures? :).

>What I wondered is whether it would be better to save a 'boot time'
>and a 'system clock ticks since boot'.  Adjustments by NTP (and other
>date setting facilities) would adjust the former, leaving the
>latter definitely monatonic.
>(probably worth using 64bit usec counts for both values).

Dennis Ferguson suggested this what, 4, 5 years back, and for the same
reasons. Seems a reasonable approach.


Note, though, that microtime() is technologically obsolete.  with > 1
GHz CPUs hitting the commodity market, we really should rework all the
internal kernel APIs to use nanoseconds rather than microseconds.  For
arches which don't (yet) have sub-microsecond resolution, just
fake nanosecond times as (microtime * 1000).