Re: Benchmark single page
| From: | Jason Granum | Date: | Thu, 22 Mar 2001 02:01:56 +0000 |
| Subject: | Re: Benchmark single page | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45056@lists.php.net to get a copy of this message | ||
Thanks. This was exactly what I was needing.
----- Original Message -----
From: "Floyd Piedad" <piedad@akasia.com>
To: "Jason Granum" <razm@assassination.org>
Cc: <php-general@lists.php.net>
Sent: Wednesday, March 21, 2001 5:53 PM
Subject: Re: [PHP] Benchmark single page
> Hi Jason,
>
> At the very start of the page to be outputted, even before the HTML tags,
put this in.
> <? php
> $time = microtime();
> $time = explode(" ",$time);
> $microtime = $time[1]+$time[0];
> $transaction_start = $microtime;
> ?>
>
> Then at the very bottom of the generated page, before the </BODY></HTML>
tag:
> <? php
> $newtime = microtime();
> $newtime = explode(" ",$newtime);
> $newmicrotime = $newtime[1]+$newtime[0];
> $elapsed_time = number_format(($newmicrotime - $transaction_start),3);
> echo "Transaction completed in ".$elapsed_time." seconds!"
> ?>
>
>
> This takes into account all of the php codes executed to generate all the
contents inbetween these two sections, including database extractions.
>
> Regards,
>
> Floyd Piedad
>
> Jason Granum wrote:
>
> > I'm wanting to benchmark a single PHP page to the millisecond (if
possible) that basicly just will put a
> >
> > This page generated in X.XXX seconds
> >
> > at the bottom of every page.
> >
> > I've tried looking through the past messages on the group but havn't
found any threads relating to this. Anyone have any ideas of how to do this
simple thing simply?
> >
> > Thanks
>
>
> --
> 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