-------微秒代碼
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
----程序開始時
$time_start = $this->microtime_float();
file_put_contents("time_start.txt",microtime(),FILE_APPEND);記錄下程序開始時間
--------程序結束時
$time_end = $this->microtime_float();
file_put_contents("time_end.txt",microtime(),FILE_APPEND);記錄程序運行完過後的時間
------算出腳本運行花了多少時間
$time = $time_end - $time_start;
file_put_contents("time.txt",$time,FILE_APPEND);