已掉线,重新登录

首页 > 绿虎论坛 > 杂类 > 超级灌水 (发帖)

标题: php页面执行时间代码

作者: @Ta

时间: 2013-09-05

点击: 1517

下载地址:http://a3u.cn/bbs/view.asp?classid=423&id=14

[隐藏样式|查看源码]


『回复列表(8|隐藏机器人聊天)』

1. 搞个飞机啊!
(/@Ta/2013-09-05 09:26//)

2. 搞个飞机啊!
(/@Ta/2013-09-05 09:26//)

3. @侏罗纪,不会
(/@Ta/2013-09-05 09:38//)

4. 这个自己都会写
(/@Ta/2013-09-05 13:03//)

5. 不用吧!
(/@Ta/2013-09-05 13:24//)

6. @二莽,这个不难
(/@Ta/2013-09-05 17:54//)

7. <?php  
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) * 1000, 1);  
}  

$runtime= new runtime; 
$runtime->start(); 
$a = 0; 
for($i=0; $i<1000000; $i++) 

$a += $i; 

$runtime->stop(); 
echo "页面执行时间:".$runtime->spent()." 毫秒"; 
?>
(/@Ta/2013-09-05 18:12//)

8. @awayar,和我的一样
(/@Ta/2013-09-05 19:34//)

回复需要登录

10月12日 05:39 星期天

本站由hu60wap6驱动

备案号: 京ICP备18041936号-1