No subject
Tue Nov 23 14:00:05 EST 2010
quickly computed with one second accuracy simply by
calling (time-of-day). (But it will be off by one
second for each time the implementation fails to
non-count a leap second.)
The time interval between two events while the program
is running is:
(let ((start (tick-count)))
(wait)
(/ (- (tick-count) start) (ticks-per-second)))
and a sub-second timer that survives re-boots and
agrees on several computers can be computed from the
epoch-of-zero-ticks.
(+ epoch-of-zero-ticks
(/ (tick-count) (ticks-per-second)))
Iff an uncounted leap second has intervened
between the epoch-of-zero-ticks and the
time the tick-count was taken then this
number will differ by more than one
from the (time-of-day).
That is appropriate, because the time of
day can not be used to compute exact
time intervals without knowledge of the
leap seconds.
-- Keith
PS: maybe the tick-count should be made
a real number of seconds and renamed,
getting rid of ticks-per-second.
http://www.ucolick.org/~sla/leapsecs/timescales.html
http://www.ucolick.org/~sla/leapsecs/onlinebib.html#POSIX
http://en.wikipedia.org/wiki/Unix_time
An account of bugs from messing up leap seconds:
http://www.maa.org/mathland/mathland_7_21.html
More information about the r6rs-discuss
mailing list