RE: [PHP] PHP Execution Timer
| From: | Beau Hartshorne | Date: | Thu, 19 Sep 2002 23:16:52 +0000 |
| Subject: | RE: [PHP] PHP Execution Timer | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116945@lists.php.net to get a copy of this message | ||
This function:
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
is provided on this page:
http://www.php.net/manual/en/function.microtime.php
and is needed for the code below to work properly.
Beau
> <?
> $timerOn = 1; // set to 0 if you want to turn it off $timestart =
> getmicrotime(); ?>
>
>
> Bottom:
>
> <?
> if($timerOn)
> {
> $timeend = getmicrotime();
> $timer = $timeend - $timestart;
> echo "timer: $timer";
> }
> ?>
>
> Similar things could be done with MySQL quereies, but I haven't looked
> into it.
>
>
> Justin French
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php