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 "Did nothing in $time seconds"; //输出运行总时间
?>

 

上一篇: Apache服务器实现用户验证   下一篇: require directives present and no Authoritative handler

提交疑问

回顶部