8 $this->startTime
= microtime();
12 $this->stopTime
= microtime();
16 return $this->elapsed($this->startTime
, $this->stopTime
);
19 function elapsed($a, $b) {
20 list($a_micro, $a_int) = explode(' ',$a);
21 list($b_micro, $b_int) = explode(' ',$b);
23 if ($a_int > $b_int) {
24 return ($a_int - $b_int) +
($a_micro - $b_micro);
26 else if ($a_int == $b_int) {
27 if ($a_micro > $b_micro) {
28 return ($a_int - $b_int) +
($a_micro - $b_micro);
30 else if ($a_micro<$b_micro) {
31 return ($b_int - $a_int) +
($b_micro - $a_micro);
37 else { // $a_int < $b_int
38 return ($b_int - $a_int) +
($b_micro - $a_micro);