復(fù)制代碼 代碼如下:
 
$t1 = explode(' ', microtime()); 
// ... 執(zhí)行代碼 ... 
$t2 = explode(' ', microtime()); 
echo ($t2[1]-$t1[1]).'s '.($t2[0]-$t1[0]).'ms'; 
復(fù)制代碼 代碼如下:
 
$t1 = microtime(true); 
// ... 執(zhí)行代碼 ... 
$t2 = microtime(true); 
echo '耗時'.round($t2-$t1,3).'秒'; 
新聞熱點
疑難解答