|
发表于 2010-4-29 21:07:03
|
显示全部楼层
在php文件头插入这个[ol]$runtime= new runtime;$runtime->start();class runtime{var $StartTime = 0;var $StopTime = 0;function get_microtime(){list($usec,$sec)=explode(' ',microtime());return((float)$usec+(float)$sec);}function start(){$this->StartTime=$this->get_microtime();}function stop(){$this->StopTime=$this->get_microtime();}function spent(){return round(($this->StopTime-$this->StartTime),6);}}[/ol]复制代码然后在要显示的地方插入[ol]$runtime->stop();echo 'Processed in ',$runtime->spent(),' second(s).';[/ol]复制代码 |
|