start[$key] = microtime(true); } // This function will stop the specified timer public function stop($key) { $this->stop[$key] = microtime(true); } // This function will show the specified timer public function elapsed($key, $round = 3, $stop = false) { if(!isset($this->start[$key])) { return false; } else { if(!isset($this->stop[$key]) && $stop == true) { $this->stop[$key] = microtime(true); } return round((microtime(true) - $this->start[$key]), $round); } } // This function will return the amount of memory the page uses while loading public function usage() { $returnValue = ''; $usage = memory_get_usage(true); if($usage < 1024) { $returnValue = $usage." bytes"; } elseif($usage < 1048576) { $returnValue = round($usage/1024, 2)." kilobytes"; } else { $returnValue = round($usage/1048576, 2)." megabytes"; } return $returnValue; } } ?>