apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@apache.org>
Subject Why not POSIX timeval?
Date Mon, 15 Jul 2002 04:37:14 GMT
On Sun, Jul 14, 2002 at 11:03:45PM -0500, William A. Rowe, Jr. wrote:
> 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.
>
> 
> E.g.
> 
>   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;

And, if we are trying to optimize the httpd case, I'm merely
saying that busec does a *really poor* job.

I'm beginning to think a timeval-like structure (perhaps two
64-bit scalars - one for secs and one for usec - in decimal) is
what we really want.  The time to access the second component becomes
free.  The precision is maintained with the usec structure.

(I could be convinced that it should be two 32-bit scalars which
matches POSIX.)

When optimizing, I think you need to know what you are optimizing
and I think the focus here is on optimizing the wrong functions.
I'm beginning to think we need to optimize the retrieval of
seconds at the possible expense of difference calculation.

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

It's trivial to take a time_t and convert it to a timeval
structure.  So, I'm not sure what you are saying here.

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

I have no idea what this is referring to.  Could you please
elaborate?  -- justin

Mime
View raw message