Re: function for clockticks since 1980?
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Sun, 29 Jul 2007 08:40:22 -0700
"Peter J. Holzer" <hjp-usenet2@xxxxxx> writes:
[...]
BTW, while I am quite sure that earlier versions of the POSIX standard
restricted time_t to an integral type,
http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html
doesn't:
* time_t and clock_t shall be integer or real-floating types.
So it is perfectly ok for time() to return 1185708188.123456 to
represent a time 123456 microseconds ater 2007-07-29 11:23:08 UTC.
Yes, in both C and POSIX. But the use of floating-point for time_t
would introduce some problems. The precision would vary considerably
over time, and some of the bits would be wasted on the ability of
representing times *extremely* close to the epoch. I prefer a uniform
precision over the entire representable range.
[...]
An implementation that chose to make time_t big in readiness for 2038
could have thrown in some extra bits at the bottom for more precision
(even if all they did was count 'time' calls).
It can still do that, but only if it switches to floating-point (which I
think would be the sane thing to do, once 2038 approaches).
I disagree. Assuming an integer representation that overflows in
2038, it's far more sensible IMHO to move to 64 bits (signed). Many
implementations have already done so, and I see no reason that *all*
implementations can't do so in the next 30 years.
[...]
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- References:
- function for clockticks since 1980?
- From: nsa . usa
- Re: function for clockticks since 1980?
- From: Ben Bacarisse
- Re: function for clockticks since 1980?
- From: nsa . usa
- Re: function for clockticks since 1980?
- From: Ben Bacarisse
- Re: function for clockticks since 1980?
- From: Peter J. Holzer
- function for clockticks since 1980?
- Prev by Date: Re: The chart of comp.lang.c
- Next by Date: Re: function for clockticks since 1980?
- Previous by thread: Re: function for clockticks since 1980?
- Next by thread: Re: function for clockticks since 1980?
- Index(es):
Relevant Pages
|