Timekeeping [Was: Re: cvs commit: src/usr.bin/vmstat vmstat.c src/usr.bin/w w.c]

Bruce Evans bde at zeta.org.au
Fri Oct 21 07:31:45 PDT 2005


On Sat, 22 Oct 2005, Bruce Evans wrote:

> On Thu, 20 Oct 2005, Poul-Henning Kamp wrote:
>> In summary:  CLOCK_MONOTONIC is our best estimate of how many SI
>> seconds the system have been runing [3].
>
> Actual testing shows that CLOCK_MONOTONIC, or possibly CLOCK_REALTIME
> less the boot time, gives a very bad estimate of how long the system has
> been running.  The difference between these clocks was about 500 seconds
> on all systems tested:
>
> % sledge:
> %  1:03PM  up 22:45, 1 user, load averages: 0.23, 0.08, 0.02
> % uptime 1 81900
> % uptime 2 82887
> ...
> A large fairly machdine-independent differece is hard to explain.  I
> will reboot after sending this to see if one of the values is much
> larger than the uptime when the uptime is < 60 seconds.

Please ignore this.  It was a stupid bug.  After fixing the bug, there
were no differences.

Bruce


More information about the cvs-all mailing list