Re: Time Taken to Process
| From: | py | Date: | Mon, 16 Jul 2001 13:40:25 +0000 |
| Subject: | Re: Time Taken to Process | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-58103@lists.php.net to get a copy of this message | ||
Mostly Taken from phpbuilder I beleive...
// =====================================================
// Function to start the timer.
// =====================================================
function start_timer(){
$timeparts = explode( " ",microtime() );
$starttime = $timeparts[1].substr( $timeparts[0], 1 );
return $starttime;
}
// =====================================================
// Function to stop the timer.
// =====================================================
function stop_timer(){
$timeparts = explode( " ",microtime() );
$endtime = $timeparts[1].substr( $timeparts[0], 1 );
return $endtime;
}
// =====================================================
// Print script execution time
// =====================================================
function script_time( $starttime, $endtime ){
$t_time = ( $endtime - $starttime );
return $t_time;
}
$starttime = start_timer();
// Script here ......
$endtime = stop_timer();
echo "<br>Exec: <b>". number_format( script_time( $starttime, $endtime ),
6 ) ."</b> sec<br>";
py
----- Original Message -----
From: Phil Spitler <pspitler@amcity.com>
To: <php-general@lists.php.net>
Sent: Monday, July 16, 2001 6:57 PM
Subject: [PHP] Time Taken to Process
> Does anyone know an easy way to tell how long a page takes to run in ms.
> Maybe some variable that can be called at the bottom of the page or
> something.
>
> THANKS!
>
> -------------------------------------
> Phil Spitler [Applications Developer]
> American City Business Journals
> p: 704.973.1049
> f: 704.973.8049
> e: mailto:pspitler@amcity.com
>
>
> --
> 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
>
>