专注于WEB前端开发, 追求更好的用户体验, 更好的开发体验 [长沙前端QQ群:234746733]

计算PHP脚本运行时间

<?php   
function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
}

//开始   
$time_start = getmicrotime();
 
//这里放你的代码

//结束
$time_end = getmicrotime(); 
$time = $time_end - $time_start;

echo "$time seconds"; //输出运行时间
?>  

/ 分类: 开发 / TrackBackhttps://xhl.me/archives/617/trackback标签: php

添加新评论 »