-------微秒代码
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);