友情链接
在线网页工具
php计算运算周期
//计算毫秒数 static function consuming($name='window',$round=null){ static $db=array(); if(is_int($name)){ $round=$name; $name='window'; } $mt=microtime(true); if('window'==$name){ $time=$mt-$_SERVER['REQUEST_TIME_FLOAT']; }else{ $time=$mt-(isset($db[$name])?$db[$name]:$_SERVER['REQUEST_TIME_FLOAT']); $db[$name]=$mt; } return is_int($round)?round($time*1000,$round).' ms':$time; }