Location: PHPKode > scripts > XML Cacher > xml-cacher/benchTimer.class.php
<?php
class BenchTimer  {


	private $startTimer;

	public function __construct() {
		$this->start();
	}


	public function start() {
		$this->startTimer = $this->getmicrotime();
	}
	public function stop() {
		$uptime = round(($this->getmicrotime() - $this->startTimer) * 1000000) / 1000;
		trigger_error($uptime." ms", E_USER_WARNING);
		flush();
	}

	protected function getmicrotime() {
		list($usec, $sec) = explode(" ",microtime());
		return ((float)$usec + (float)$sec);
	}
	
	public function __destruct() {
		$this->stop();
	}

}




?>
Return current item: XML Cacher