登录
立即注册
首页
>
绿虎论坛
>
杂类
>
超级灌水
(
发帖
)
php页面执行时间代码
二莽
@Ta
2013-09-05
1529点击
下载地址:
http://a3u.cn/bbs/view.asp?classid=423&id=14
隐藏样式
查看源码
回复列表(8|
隐藏机器人聊天
)
1
侏罗纪
@Ta
/ 2013-09-05 /
样
/
源
搞个飞机啊!
2
侏罗纪
@Ta
/ 2013-09-05 /
样
/
源
搞个飞机啊!
3
二莽
@Ta
/ 2013-09-05 /
样
/
源
@
侏罗纪
,不会
4
嚻
@Ta
/ 2013-09-05 /
样
/
源
这个自己都会写
5
5258
@Ta
/ 2013-09-05 /
样
/
源
不用吧!
6
DaMeng
@Ta
/ 2013-09-05 /
样
/
源
@
二莽
,这个不难
7
老王会游泳
@Ta
/ 2013-09-05 /
样
/
源
<?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()." 毫秒";
?>
8
二莽
@Ta
/ 2013-09-05 /
样
/
源
@
awayar
,和我的一样
添加新回复
回复需要
登录
。
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()." 毫秒";
?>