CoreFiles by mySites.guru
timer.php43 lines, 836 bytes, from Joomla_1.5.21-Stable-Full_Package.zip
Raw History Compare with 1.5.20
md5
e60bf17402884456520a01c272ea92a7
sha1
add4cbdf9854dc359a2a192d81aeddd1494be270
sha256
5634c011e9e5eda0dc9a85f7aee6b4e88ee578fbc54fa9b51c78b47d3a4aab6b
<?php

class Timer {
	var $startTime;
	var $stopTime;

	function start() {
		$this->startTime = microtime();
	} //start

	function stop() {
		$this->stopTime = microtime();
	} //stop

	function getTime() {
		return $this->elapsed($this->startTime, $this->stopTime);
	} //getTime

	function elapsed($a, $b) {
		list($a_micro, $a_int) = explode(' ',$a);
		list($b_micro, $b_int) = explode(' ',$b);

		if ($a_int > $b_int) {
			return ($a_int - $b_int) + ($a_micro - $b_micro);
		}
		else if ($a_int == $b_int) {
			if ($a_micro > $b_micro) {
				return ($a_int - $b_int) + ($a_micro - $b_micro);
			}
			else if ($a_micro<$b_micro) {
				return ($b_int - $a_int) + ($b_micro - $a_micro);
			}
			else {
				return 0;
			 }
		}
		else { // $a_int < $b_int
			return ($b_int - $a_int) + ($b_micro - $a_micro);
		}
	} //elapsed
} //Timer

?>

The same content is in 26 releases, Joomla 1.5.1 to 1.5.26. See them all, or every version of this file.