digits = $digits; $this->start = $this->getmicrotime(); } // return with pattern function end ($digits=false, $pattern=false) { $end = $this->getmicrotime(); $digits = ( preg_match("/[0-9]{1,2}/", $digits) ) ? $digits : $this->digits ; $pattern = ( stristr($pattern, '%s') != false ) ? $pattern : $this->pattern ; $this->time = number_format( ($end - $this->start), $digits); return str_replace('%s', $this->time, $pattern); } // return time only ignoring pattern function term ($digits=false) { $end = $this->getmicrotime(); $digits = ( preg_match("/[0-9]{1,2}/", $digits) ) ? $digits : $this->digits ; return $this->time = number_format( ($end - $this->start), $digits); } function getmicrotime () { list($usec, $sec) = explode(' ', microtime()); $r = floatval($usec) + floatval($sec); return($r); } } ?>