В шапку: PHP: function get_sec() { $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; return $mtime; } $start_time = get_sec(); в футер: PHP: $exec_time = get_sec() - $start_time; printf ("<!-- Время выполнения: %f сек.-->", $exec_time); p.s код не мой =0
угу. все запросы во время выполнения скрипта не входят. надо перед каждым "ставить на паузу" таймер =)
одним разом я даже создал такой класс: PHP: <? class timer { private $start = 0; private $stop = 0; private $running = false; private $time = 0; function reset () { $this->time = 0; $this->running = true; $this->start = microtime(true); } function start () { if (!$this->running) { $this->running = true; $this->start = microtime(true); } } function check () { if ($this->running) { return $this->time + microtime(true) - $this->start; } else { return $this->time; } } function stop () { $this->stop = microtime(true); $this->running = false; $this->time += $this->stop - $this->start; return $this->time; } } соотв можно чекать и не останавливать, можно остановить и получить значение, потом можно кажется можно запустить и считать дальше. Ну и ресет.