William A. Rowe, Jr. wrote:

At 09:31 PM 6/10/2002, I wrote:

usec * 1048575 / 1000000 = busec

bsec * 1000000 / 1048575 = usec


whoops, s/1048575/1048576/


That's a major improvement.  I was going to complain about
the need for both a 64-bit multiplication and a 64-bit
division to do the conversion, but 1048576 only requires a
shift.

In general, I like this design:

* It combines most of the benefits of the "struct apr_timeval"
approach with most of the benefits of the current seconds*1000000+microseconds
scalar representation.


* It leaves 44 bits of a 64-bit representation free to hold the
 time_t, so it won't overflow for a few hundred thousand years.

* And the transition is easy: just change APR_USEC_PER_SEC to 1048576
 and tell all users of APR to recompile.

+1 for the binary microseconds implementation
-0 for continuing to call it apr_time_t

--Brian




Reply via email to