Subject: Re: why times are often off by up to a second
To: None <perry@piermont.com>
From: Dennis Ferguson <dennis@juniper.net>
List: tech-kern
Date: 02/24/1999 10:32:43
> I've been thinking about a bunch of ways to fix this nit, but most of
> them involve spinning for up to one second, which isn't really a good
> idea. I was therefore wondering if people on tech-kern had any
> opinions on the "correct" method.

When you do a resettodr() does the fractional seconds counter in the tod
clock get reset (i.e. the next increment is precisely one second from
when you set it), or does that increment come some random interval between
0 and 1 seconds later?  If the former, you could get some precision by
deferring doing a resettodr() to the on-time second, otherwise you have
an inherent error of +/- 0.5 seconds which could be measured by some
hard-to-get-right sampling and averaging, but which couldn't be corrected
across reboots.

You could improve things a little bit by being careful to round, rather than
truncate, when setting and reading the hardware clock.  This would at least
give you a zero mean error, though the variance wouldn't change.

Dennis Ferguson