On Monday 08 September 2003 10:29, [EMAIL PROTECTED] wrote:
> Hi all,
>
> I paid attention that the time showed by `date' is not the accurate time -
> thje clock slows down by ~150ms every 16 secs, whearas `hwclock' shows the
> exact time. In my application I need a very accurate time and I prefer to
> retrieve it with `date' and not with `hwclock' (I'm using NTP and
> syncronizing the time with NTP, then updating the hardware clock can be a
> pain).
>

The best way to resolve some problems is to stop casuing them :-)

I'm willing to bet that NTP discovered that your system clock is a little bit 
early, so it tries to fix it. Since you REALLY don't want to reverse the 
system clock and return time backwards the way NTP daemons do it (if the 
difference is small enough) is to "dampen" the clock - askthe kernel to cause 
the system time to run a little slower then the hardware clock (or faster, 
depending on the direction of the skew detected) until it is syncronized with 
the "real" time.

Since "date" shows this sytem clock, you see the dampning happening, whereas 
the hardware clock is not effected.

Oh, and why use an external utility and not call gettimeofday() from your 
program? I assume you don't need exact timing in a script...

Gilad

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to