Medir el tiempo de ejecución de un script php

Tomado de

http://forum.powweb.com/archive/index.php/t-7928.html

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

$time_start = getmicrotime();

mysql_query( "" );

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

echo "Did nothing in $time seconds";

</code>

Etiquetas