diff -Nur apache_1.3.29-orig/src/include/httpd.h apache_1.3.29/src/include/httpd.h --- apache_1.3.29-orig/src/include/httpd.h Sat Oct 25 01:11:40 2003 +++ apache_1.3.29/src/include/httpd.h Thu Apr 29 13:33:45 2004 @@ -710,6 +710,7 @@ const char *hostname; /* Host, as set by full URI or Host: */ time_t request_time; /* When the request started */ + double request_microtime; /* When the request started in microtime */ const char *status_line; /* Status line, if set by script */ int status; /* In any case */ @@ -1229,3 +1230,11 @@ #endif #endif /* !APACHE_HTTPD_H */ + +#include + +#define MICRO_NUL '\0' +#define MICRO_IN_SEC 1000000.00 +#define MICRO_SEC_IN_MIN 60 + +double microtime(void); diff -Nur apache_1.3.29-orig/src/main/http_protocol.c apache_1.3.29/src/main/http_protocol.c --- apache_1.3.29-orig/src/main/http_protocol.c Tue Feb 4 02:13:22 2003 +++ apache_1.3.29/src/main/http_protocol.c Thu Apr 29 13:33:45 2004 @@ -1036,6 +1036,7 @@ ap_bsetflag(conn->client, B_SAFEREAD, 0); r->request_time = time(NULL); + r->request_microtime = microtime(); r->the_request = ap_pstrdup(r->pool, l); r->method = ap_getword_white(r->pool, &ll); uri = ap_getword_white(r->pool, &ll); diff -Nur apache_1.3.29-orig/src/main/http_request.c apache_1.3.29/src/main/http_request.c --- apache_1.3.29-orig/src/main/http_request.c Sat Oct 18 23:15:58 2003 +++ apache_1.3.29/src/main/http_request.c Thu Apr 29 13:33:45 2004 @@ -807,6 +807,7 @@ rnew = make_sub_request(r); rnew->hostname = r->hostname; rnew->request_time = r->request_time; + rnew->request_microtime = r->request_microtime; rnew->connection = r->connection; rnew->server = r->server; rnew->request_config = ap_create_request_config(rnew->pool); @@ -902,6 +903,7 @@ rnew = make_sub_request(r); rnew->hostname = r->hostname; rnew->request_time = r->request_time; + rnew->request_microtime = r->request_microtime; rnew->connection = r->connection; rnew->server = r->server; rnew->request_config = ap_create_request_config(rnew->pool); @@ -1426,6 +1428,7 @@ new->proto_num = r->proto_num; new->hostname = r->hostname; new->request_time = r->request_time; + new->request_microtime = r->request_microtime; new->main = r->main; new->headers_in = r->headers_in; diff -Nur apache_1.3.29-orig/src/main/util.c apache_1.3.29/src/main/util.c --- apache_1.3.29-orig/src/main/util.c Tue Feb 4 02:13:23 2003 +++ apache_1.3.29/src/main/util.c Thu Apr 29 13:33:45 2004 @@ -2369,3 +2369,21 @@ } *dest = 0; } + +double microtime(void) +{ + struct timeval tp; + long sec = 0L; + double msec = 0.0; + double tsec = 0.0; + + if(gettimeofday((struct timeval *) &tp, (MICRO_NUL)) == 0) + { + msec = (double) (tp.tv_usec / MICRO_IN_SEC); + sec = tp.tv_sec; + if(msec >= 1.0) msec -= (long) msec; + tsec = msec + sec; + } + + return tsec; +} diff -Nur apache_1.3.29-orig/src/modules/standard/mod_log_config.c apache_1.3.29/src/modules/standard/mod_log_config.c --- apache_1.3.29-orig/src/modules/standard/mod_log_config.c Tue Feb 4 02:13:28 2003 +++ apache_1.3.29/src/modules/standard/mod_log_config.c Thu Apr 29 13:33:45 2004 @@ -210,6 +210,10 @@ #define LOG_BUFSIZE (512) #endif +#define MICRO_NUL '\0' +#define MICRO_IN_SEC 1000000.00 +#define MICRO_SEC_IN_MIN 60 + /* * multi_log_state is our per-(virtual)-server configuration. We store * an array of the logs we are going to use, each of type config_log_state. @@ -446,7 +450,8 @@ static const char *log_request_duration(request_rec *r, char *a) { - return ap_psprintf(r->pool, "%ld", time(NULL) - r->request_time); + /*** return ap_psprintf(r->pool, "%.ld", time(NULL) - r->request_time); ***/ + return ap_psprintf(r->pool, "%.4f", microtime() - r->request_microtime); } /* These next two routines use the canonical name:port so that log