Re: How can i calculate total process time?
| From: | John Nichel | Date: | Tue, 15 Mar 2005 15:22:47 +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-210797@lists.php.net to get a copy of this message | ||
Chris Boget wrote:
<snip>
// At the very beginning of the script $startTime = date( 'U' ); // At the very end of the script $endTime = date( 'U' ); echo 'Total processing time: ' . ( $endTime - $startTime ) . ' second(s)'; </snip>I would use microtime instead of date('U') or time(); since date and time deal in full seconds. If your script takes less than a second to process, you could end up with equal starting and ending times, resulting in 0 seconds to process. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com