RE: [PHP] Page Generation Time (your thoughts?)
| From: | Maciek Uhlig | Date: | Tue, 08 Aug 2000 19:04:02 +0000 |
| Subject: | RE: [PHP] Page Generation Time (your thoughts?) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10753@lists.php.net to get a copy of this message | ||
Basically, there are two remarks:
- you shouldn't output text after </HTML>
- you should think about what you get while your script starts at, let's
say, (n).99 and ends at (n+1):01. You end up with -0.98 which is not what
you want. Better use getmicrotime() function from
http://www.php.net/manual/function.microtime.php
comment
Maciek
> -----Original Message-----
> From: Cosenza, Mario [mailto:mcosenza@engsvcs.com]
> Sent: Tuesday, August 08, 2000 8:14 PM
> To: php-general@lists.php.net
> Subject: [PHP] Page Generation Time (your thoughts?)
>
>
> Is microtime() the best way to calculate the page generation time?
>
> Considering there are a lot of DB calls, included files, etc. I was
> wondering how long it took to build the page.
>
> I (basically) did the following...
>
>
> $start=explode(" ", microtime());
> <HTML>
> ...a bunch of DB calls & PHP code & HTML code...
> </HTML>
> $finish=explode(" ", microtime());
> echo "Page Generated in" . $finish[0]-$start[0] . "seconds";
>
>
> Is this the best (most accurate) way to do this?
>
> All the DB calls, includes, etc. should be completed by the end
> of the page,
> right?
>
> Thanks,
> Mario
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>