Re: How to compute time to load page...
| From: | Hugh Bothwell | Date: | Sun, 09 Dec 2001 15:43:21 +0000 |
| Subject: | Re: How to compute time to load page... | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-77154@lists.php.net to get a copy of this message | ||
"Alex Shi" <chpshi@netvigator.ca> wrote in message
news:006b01c18063$336e9f90$0105050a@pony...
> Basically I agree with you. But the second time to get time must be done
> after the page is rendered on local browser. So I suggest to use
Javascript
> for the second time to get time, and pass the first time value into a js
> function.
As another person noted, there may be significant differences
between client and server clocks. For accuracy, you must use
the same clock for both measurements - and you cannot use
the client-side clock, because javascript will not run until the
page is fully loaded.
How about this: embed 'start' and 'end' timestamps in the page
when it is generated, then use a javascript fake preload (call
another script instead of an image) to pass them back - the
time they are received is your timestamp for the page being
loaded. This will obviously include a small additional delay for
the second request, but it should give you a close upper bound
on the actual time.