starTime=$this->getMicTime(); } public function stop(){//获取结束时间 $this->stopTime=$this->getMicTime(); } public function spent(){//计算程序持续时间 return round($this->stopTime-$this->starTime,5)*1000;//获取毫秒数 } }