Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: "A diagram of C23 basic types" Date: Mon, 14 Apr 2025 15:15:38 -0700 Organization: None to speak of Lines: 20 Message-ID: <87plhe2xv9.fsf@nosuchdomain.example.com> References: <87y0wjaysg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Tue, 15 Apr 2025 00:15:39 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a2350407d780bb528cb106f4e5e26372"; logging-data="2296845"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/TZhsNP4+Mek4cEKcjj5i" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:GttC6mjgd1DUMEiG+ACQyrMXnL4= sha1:Navo5bHL4R0MIZiM1T4X4h8DGMc= Bytes: 2111 BGB 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.com void Void(void) { Void(); } /* The recursive call of the void */