httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: ap_current_time() is not intuitive
Date Mon, 03 Jan 2000 18:50:47 GMT
On Mon, 3 Jan 2000, Bill Stoddard wrote:

> Can we collapse the ap_current_time() function into either ap_make_time or
> ap_get_curtime()? Here is how you use APR to get the current time today:

We can fold the current_time function into make_time, but not get_curtime.
I basically mimiced the way Windows does their timing functions for the
first two.  One call is probably good enough.  The get_curtime function
needs to stay, because there are two ways to get the time stored in a time
object, seconds since epoch or an expanded time structure.  We need to
have accessors for each of these.


> ap_make_time(&time, p);
> ap_current_time(time);
> ap_get_curtime(time, &thetime);
> ap_make_time creates the ap_time_t structure. Then ap_current_time() makes
> the underlying system call to initialize the ap_time_t structure. Then
> ap_get_curtime returns the time in seconds since 1/1/1970.  Note that
> ap_get_curtime is not getting the current time, it is getting the time from
> when ap_current_time was called. This is non-intutitive as hell.
> ________________________________________________
> Bill Stoddard
> Come to the first official Apache Software Foundation
> Conference!  <http://ApacheCon.Com/>

Ryan Bloom               
6209 H Shanda Dr.
Raleigh, NC 27609		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.

View raw message