function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec (float)$sec);
}
$time_start = getmicrotime();//Start timing and place it in the program header
for ($i=0; $i < 1000; $i ){
//do nothing, 1000 times
}
$time_end = getmicrotime();//End timing and put it at the end
$time = $time_end - $time_start;
echo "Did nothing in $time seconds";