PHP expert |
|
<?
function getmicrotime() {
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$time_start = getmicrotime();
for ($i=0; $i < 1000; $i++){
// Doe 1000 keer niets
}
$time_end = getmicrotime();
$time = $time_end - $time_start;
echo "Niets gedaan in $time seconden";
?>
<? function getmicrotime() { return ((float)$usec + (float)$sec); } $time_start = getmicrotime(); for ($i=0; $i < 1000; $i++){ // Doe 1000 keer niets } $time_end = getmicrotime(); $time = $time_end - $time_start; echo "Niets gedaan in $time seconden"; ?>
zo op php.net gevonden onder microtime |