Page 1 of 1

Needs help!

Posted: Sat Jul 06, 2002 11:34 am
by kaily
Is it possible to get "how much time does the PHP script cost to run"?
Sorry for my english!

Posted: Sat Jul 06, 2002 12:56 pm
by martin
This should do the trick, just insert your script where indicated.

Code: Select all

function getmicrotime(){ 
    list($usec, $sec) = explode(" ",microtime()); 
    return ((float)$usec + (float)$sec); 
    } 

$time_start = getmicrotime();
    
//your code here

$time_end = getmicrotime();
$time = $time_end - $time_start;

echo "Did nothing in $time seconds";