php 代码运行时间查看类
explode(" ",microtime());
return ((float)$usec (float)$sec);
}
function start()//页面开始执行函数,返回开始页面执行的时间
{
$this->starttime=$this->getmicrotime();
}
function end()//显示页面执行的时间
{
$this->stoptime=$this->getmicrotime();
$this->spendtime=$this->stoptime-$this->starttime;
//return round($this->spendtime,10);
}
function display()
{
//$this->end();
echo "<p>运行时间:".round($this->spendtime,10)."秒</p>";
}
}
/*调用方法
$timer=new Runtime();
$timer->start();
$timer->end();
view sourceprint?
$timer->display();
您可能感兴趣的文章:
查看php代码运行时间的类
php 代码运行时间查看类
php获取函数执行时间的简单例子
Python是一门怎样的编程语言
一个计算程序运行时间的php类
php设置运行时间的方法
MicrosoftVBscript运行时错误
linux查看PHP进程是否在执行的实例代码
计算php脚本执行时间的示例代码
php获取目标函数执行时间的实例代码