apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bri...@apache.org>
Subject Re: Why not POSIX time_t?
Date Mon, 15 Jul 2002 19:55:13 GMT
Cliff Woolley wrote:

>On Mon, 15 Jul 2002, Brian Pane wrote:
>
>  
>
>>    (seconds << 20) + microseconds
>>    
>>
>
>Yeah, but addition and subtraction of the resulting scalars would require
>just as many carry/underflow checks as a structure would...
>

You can rely on normal scalar arithmetic to handle the carry.
The only catch is that the microseconds can become as large as
2^20 - 1.  But you only have to check for that case when extracting
seconds or microseconds.  That's bad, although not as bad as a
64-bit division.

--Brian



Mime
View raw message