Re: Everyone on the road?
| From: | Andi Gutmans | Date: | Fri, 06 Aug 2004 21:01:39 +0000 |
| Subject: | Re: Everyone on the road? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-11975@lists.php.net to get a copy of this message | ||
At 08:59 AM 8/6/2004 -0700, Sara Golemon wrote:
I meant to mention this a while ago, but it slipped my mind. Most web servers do that time() call for us at the beginning of the request because they need it for logging purposes. I think the right approach here is to add a SAPI call to expose this. For Apache-1.3 it is right in the request_rec in the request_time field. Obviously the SAPI call would simply do the time() call itself if it can't fetch it from somewhere internally. It sounds good enough, but I'd worry about people using this in incompletely-thought-out benchmarking scripts. A SAPI which supports the request time record would appear to take slightly longer than a SAPI which does not (the time between processing the request in the web server and passing off to PHP {plus compile, plus execute down to that instructuion}) <note> Do <emphasis>NOT</emphasis> use this method for benchmarking between different webservers, inconsistent implementations could give unexpected results. </note>If you call it get_request_start_time() it should make it clearer what it means. I guess we could put it into SAPI I don't see any disadvantage although in any case, doing it one more time per-request wouldn't be that bad either. I hope to have more time towards the end of next week and then I can hopefully make this improvement. Andi