Re: How can i calculate total process time?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux