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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]