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 <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]
>
>
> --
> 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]
>
>


-- 
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]

Reply via email to