PHPのマイクロタイム実装の使い方
function getCurrentTime () { list ($msec, $sec) = explode(" ", microtime()); return (float)$msec + (float)$sec; }
使い方
$begin = getCurrentTime(); sleep(10); $end = getCurrentTime(); $spend = $end - $begin; echo "脚本执行时间为:".$spend."\n";