Sujet : Re: "A diagram of C23 basic types"
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 14. Apr 2025, 23:15:38
Autres entêtes
Organisation : None to speak of
Message-ID : <87plhe2xv9.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Gnus/5.13 (Gnus v5.13)
BGB <
cr88192@gmail.com> writes:
[...]
More practical is storing the time in microseconds.
>
A 64-bit integer holding the time in microseconds covers pretty much
the entirety of human history thus far.
It covers a range of about 600,000 years.
But C already has "struct timespec", a struct containing a time_t
and a count of nanoseconds.
The fact that there are two different types for representing times
(ignoring struct tm) is mildly inconvenient, but struct timespec
(added in C11) gives better range and precision than a single
integer value could in 64 or fewer bits.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */