You are here: Re: Unix Time and Leap Seconds « PHP Programming Language « IT news, forums, messages
Re: Unix Time and Leap Seconds

Posted by David T. Ashley on 06/24/07 16:18

"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.
--
David T. Ashley (dta@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация