ex:

class timer
{
        private 
$start;
        private 
$end;

        public function 
timer()
        {
                
$this->start microtime(true);
        }

        public function 
Finish()
        {
                
$this->end microtime(true);
        }

        private function 
GetStart()
        {
                if (isset(
$this->start))
                        return 
$this->start;
                else
                        return 
false;
        }

        private function 
GetEnd()
        {
                if (isset(
$this->end))
                        return 
$this->end;
                else
                        return 
false;
        }

        public function 
GetDiff()
        {
                return 
$this->GetEnd() - $this->GetStart();
        }

        public function 
Reset()
        {
                
$this->start microtime(true);
        }

}



arrow
arrow
    全站熱搜
    創作者介紹
    創作者 benjamin16pp 的頭像
    benjamin16pp

    程式筆記

    benjamin16pp 發表在 痞客邦 留言(0) 人氣()