Just an addition and a little modification to the Benchmark timer.php class

From: Date: Sun, 27 Oct 2002 13:44:14 +0000
Subject: Just an addition and a little modification to the Benchmark timer.php class
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-10290@lists.php.net to get a copy of this message
I have slightly modified the class to a) not display the info in the destructor b) added functionality to controll to how many decimal places the time difference is returned wasnt sure about this diff becouse i did it in windows but i have attached the modified class just in case Thanks Regards Richard . U -------------------------------------------------- 63 -------------------------------------------------- 63 * Number of decimal places of time elapsed * * @var int * @access private */ var $_persission; /** -------------------------------------------------- 83 function Benchmark_Timer($auto = false) { -------------------------------------------------- 91 function Benchmark_Timer($auto = false, $persission=6) { -------------------------------------------------- 89 -------------------------------------------------- 97 $this->_persission = $persission; -------------------------------------------------- 99 $this->display(); } -------------------------------------------------- 108 } } /** * Sets persission of the time difference. * * @param int number of decimal places persissions * @access public */ function setPersission($persission) { if((is_int($persission))&&($persission>0)){ $this->_persission = $persission; } -------------------------------------------------- 104 -------------------------------------------------- 125 * Gets persission of the time difference. * * @access public */ function getPersission() { return $this->_persission; } /** -------------------------------------------------- 210 return bcsub($this->markers[$end], $this->markers[$start], 6); -------------------------------------------------- 241 return bcsub($this->markers[$end], $this->markers[$start], $this->_persission);

« previous php.pear.dev (#10290) next »