phpコードの運行時間はクラスコードを調べて共有します。


 
//date:2011-08-05
class RunTime//
{
private $starttime;//
private $stoptime;//
private $spendtime;//
function getmicrotime()//
{
list($usec,$sec)=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();