欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php代碼運行時間查看類代碼分享

 更新時間:2011年08月06日 18:36:16   作者:  
php代碼運行時間查看類代碼,主要是用來查看php代碼的運行時間。
復制代碼 代碼如下:

//date:2011-08-05
class RunTime//頁面執(zhí)行時間類
{
private $starttime;//頁面開始執(zhí)行時間
private $stoptime;//頁面結(jié)束執(zhí)行時間
private $spendtime;//頁面執(zhí)行花費時間
function getmicrotime()//獲取返回當前微秒數(shù)的浮點數(shù)
{
list($usec,$sec)=explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function start()//頁面開始執(zhí)行函數(shù),返回開始頁面執(zhí)行的時間
{
$this->starttime=$this->getmicrotime();
}
function end()//顯示頁面執(zhí)行的時間
{
$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>";
}
}
/*調(diào)用方法
$timer=new Runtime();
$timer->start();

相關(guān)文章

最新評論