Re: How can i calculate total process time?
| From: | Eli | Date: | Sun, 06 Mar 2005 13:59:31 +0000 |
| Subject: | Re: How can i calculate total process time? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-210091@lists.php.net to get a copy of this message | ||
M. Sokolewicz wrote:
fetch the microtime() at the top of the script, and at the bottom of the script you fetch it again. Subtract the first from the later, and you're left with the time it took. Then change it to a human-readable form, and you're done. You can't get closer without hacking the ZEOn top use this: <?php $mtime = explode(" ",microtime()); $starttime = $mtime[1] + $mtime[0]; ?> On the end use this: <?php $mtime = explode(" ",microtime()); $endtime = $mtime[1] + $mtime[0]; echo "\n\n\n<hr><b>".round($endtime-$starttime,3)." sec</b>"; ?>