
December 21st, 2002, 05:53 PM
|
|
Contributing User
|
|
Join Date: Oct 2002
Location: Washington, DC
Posts: 317
Time spent in forums: 2 m 3 sec
Reputation Power: 6
|
|
PHP Code:
function bench_it()
{
$mtime = explode( ' ', microtime() );
$msec = ( double ) $mtime[0];
$sec = ( double ) $mtime[1];
return $sec + $msec;
}
$st_bnch = bench_it();
/*
Your application code
*/
$en_bnch = bench_it();
The above will bind the start and end time to said scalars. To show just the microseconds, use this format ->
PHP Code:
$runtime = $en_bnch - $st_bnch;
echo $runtime;
If you wanna display a more readable format, use (or something simular) ->
PHP Code:
$runtime = round( $en_bnch - $st_bnch, 3 );
echo( 'Page execution took ' . $runtime . ' seconds.' );
Chow...
__________________
~ Joe Penn
We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?
Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.
|