|
Posted by Jerry Stuckle on 06/25/07 00:54
David T. Ashley wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:YdWdncWaU_Y1E-PbnZ2dnUVZ_rfinZ2d@comcast.com...
>> David T. Ashley wrote:
>>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>> news:BP2dnRB4hISwQODbnZ2dnUVZ_u2mnZ2d@comcast.com...
>>>> So they have to be adjusted. And even though NTP tries to speed up and
>>>> slow the clock - it's not perfect. And at times the clock WILL jump
>>>> forwards or backwards at least one second.
>>> My documentation for NTP proper says it won't do this.
>>>
>>> What kind of events are you speaking of that might cause discontinuities?
>>>
>> It depends on a lot of things. Many systems do not have the necessary
>> hardware adjust clock speed. So just like any clock, if it's running
>> fast, it must be set back sooner or later.
>
> Interesting. I had assumed that adjtimex() was available on just about
> every system that would run PHP.
>
> Also, I'm not sure that adjusting time has much to do with hardware. My
> understanding of it was that every system has the capability for RTI (some
> sort of real-time interrupt at a periodic rate--perhaps adjustable, perhaps
> not), but maybe something around 100Hz is typical.
>
> In any case, my understanding of Linux timekeeping was that on every
> timetick, an integer was added to the internal time. The integer would be
> fairly large, so that the timekeeping precision is several orders of
> magnitude finer than the RTI rate. It would be this integer adjusted to
> change the effective rate of the clock, not hardware.
>
> For example, let's assume that the RTI rate is 100Hz, and we maintain time
> as a 64-bit integer, with the radix point after the first 32 bits. Then, on
> each tick, we add 42,949,673 to the integer. Every 100 ticks, the upper 32
> bits will be incremented. Time adjustment is possible to about 1 part in 43
> million. And the system is very cheap (integer arithmetic is cheap).
>
> For example, if we want the clock to run a bit slower, we add 42,949,672
> each time rather than 42,949,673.
>
> What did I miss?
>
> Is hardware really involved?
>
> Can you point me to documentation about any system where the rate can't be
> adjusted under Linux?
>
> Thanks, Dave.
Dave (and others who responded)
That is true, it depends on the clock frequency. However, the system
clock runs even when the system is turned off - it's battery operated
and that's why you don't have to reset the clock every time you start up.
Yes, some Linux versions have the ability to "override" the system clock
and display a different time than the system has. But that doesn't mean
the system clock is accurate, or the software clock is accurate after a
restart.
And it doesn't mean the time the program sees will never need to be
reset either way.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|