php计算执行时间

<?php
class excutionTime() {
private $startTime = 0;
private $endTime = 0;
private function time_floate(){
list($usec, $sec) = explode(' ', microtime());
return((floate)$usec + (floate)$sec);
}
public function start() {
$this->startTime = $this->time_floate();
}
public function end() {
$this->endTime = $this->time_floate();
}
public function spent(){
return ($this->endTime - $this->startTime) * 1000;
}
}
?>

你可能感兴趣的:(PHP)