_timing_start_times[$name] = explode(' ', microtime()); } function stop($name='default') { $this->_timing_stop_times[$name] = explode(' ', microtime()); } function getTime($name='default') { if (!isset($this->_timing_start_times[$name])) { return 0; } if (!isset($this->_timing_stop_times[$name])) { $stop_time = explode(' ', microtime()); } else { $stop_time = $this->_timing_stop_times[$name]; } // Do the big numbers first so the small ones aren't lost. $current = $stop_time[1] - $this->_timing_start_times[$name][1]; $current += $stop_time[0] - $this->_timing_start_times[$name][0]; return sprintf($this->time_format, $current); } } ?>