function thistime()
{
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
function spent($a,$b)
{
return ($b - $a) * 1000;
}
$start1[]=array('起点',thistime());
$k=0;
for($j=0;$j<10000;$j++){
$k++;
}
$start1[]=array('写了一个1加到1万的循环',thistime());
<table cellpadding=5 bgcolor="blue" cellspacing=1 border=0>
<tr bgcolor="white"><th>标记</th><th>毫秒</th></tr>
';
$i=0;
$alltime=0;
$timedelay=0;
foreach($start1 as $iii){
if($i!=0){$timedelay=spent($start1[$i-1][1],$start1[$i][1]);}
echo '<tr bgcolor="white"><td>'.$iii[0].'</td><td>'.$timedelay.'</td></tr>';
$alltime+=$timedelay;
$i++;
}
echo '</table>';
echo '<hr/>总时间:'.$alltime;
exit;