Re: How can i calculate total process time?

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

 



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 ZE

On 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>";
?>

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