您好,欢迎访问一九零五行业门户网

php计算脚本执行时间

利用php的microtime实现
function getcurrenttime () { list ($msec, $sec) = explode(" ", microtime()); return (float)$msec + (float)$sec; }
如何使用
$begin = getcurrenttime(); sleep(10); $end = getcurrenttime(); $spend = $end - $begin; echo "脚本执行时间为:".$spend."\n";
其它类似信息

推荐信息