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

php代碼運(yùn)行時(shí)間查看類代碼分享

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

//date:2011-08-05
class RunTime//頁面執(zhí)行時(shí)間類
{
private $starttime;//頁面開始執(zhí)行時(shí)間
private $stoptime;//頁面結(jié)束執(zhí)行時(shí)間
private $spendtime;//頁面執(zhí)行花費(fèi)時(shí)間
function getmicrotime()//獲取返回當(dāng)前微秒數(shù)的浮點(diǎn)數(shù)
{
list($usec,$sec)=explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function start()//頁面開始執(zhí)行函數(shù),返回開始頁面執(zhí)行的時(shí)間
{
$this->starttime=$this->getmicrotime();
}
function end()//顯示頁面執(zhí)行的時(shí)間
{
$this->stoptime=$this->getmicrotime();
$this->spendtime=$this->stoptime-$this->starttime;
//return round($this->spendtime,10);
}
function display()
{
//$this->end();
echo "<p>運(yùn)行時(shí)間:".round($this->spendtime,10)."秒</p>";
}
}
/*調(diào)用方法
$timer=new Runtime();
$timer->start();

相關(guān)文章

最新評(píng)論