[ Index ] |
|
Code source de Joomla 1.0.13 |
1 <?php 2 3 class Timer { 4 var $startTime; 5 var $stopTime; 6 7 function start() { 8 $this->startTime = microtime(); 9 } //start 10 11 function stop() { 12 $this->stopTime = microtime(); 13 } //stop 14 15 function getTime() { 16 return $this->elapsed($this->startTime, $this->stopTime); 17 } //getTime 18 19 function elapsed($a, $b) { 20 list($a_micro, $a_int) = explode(' ',$a); 21 list($b_micro, $b_int) = explode(' ',$b); 22 23 if ($a_int > $b_int) { 24 return ($a_int - $b_int) + ($a_micro - $b_micro); 25 } 26 else if ($a_int == $b_int) { 27 if ($a_micro > $b_micro) { 28 return ($a_int - $b_int) + ($a_micro - $b_micro); 29 } 30 else if ($a_micro<$b_micro) { 31 return ($b_int - $a_int) + ($b_micro - $a_micro); 32 } 33 else { 34 return 0; 35 } 36 } 37 else { // $a_int < $b_int 38 return ($b_int - $a_int) + ($b_micro - $a_micro); 39 } 40 } //elapsed 41 } //Timer 42 43 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 14:43:32 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |