apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Why not POSIX time_t?
Date Mon, 15 Jul 2002 04:03:45 GMT
At 10:56 PM 7/14/2002, Justin Erenkrantz wrote:
>On Sun, Jul 14, 2002 at 07:42:09PM -0700, Brian Pane wrote:
> > It's a little more efficient if you put the result in
> > a struct rather than a scalar, but you still have to do
> > the carry from the seconds field to the microseconds field
> > if time1.tv_usec < time2.tv_usec.  Minimally, subtraction
> > of the structs requires two subtractions, a comparison,
> > and a conditional branch.
>Now, what are we more likely to do:
>1) Retrieve the seconds from the time value
>2) Subtract two time values

Correction, take the difference between two values in seconds.

Let's not muddy the waters with the definition of 'time' since two
time values could represent usec or sec precision.

That is a more frequent case, yes.  How httpd stores the return
values from apr functions is up to httpd.  If all it needs is elapsed
seconds, and int suffices quite nicely.


   int request_start = apr_time_as_sec(apr_time_now());
   int request_end = apr_time_as_sec(apr_time_now());

   int elapsed_sec = request_end - request_start;

>For httpd, I'm pretty sure what the answer is.  And, I believe the
>answer to that dictates our time structure.  -- justin

And apr_fileinfo_t ctime, mtime and atime become ... ints?

Glad to see we are staying on topic.  Interesting to see some who
have folded their interest in the library project.


View raw message