note 75730 deleted from function.microtime by tularis
| From: | tularis@php.net | Date: | Sun, 22 Jun 2008 12:05:56 +0000 |
| Subject: | note 75730 deleted from function.microtime by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140669@lists.php.net to get a copy of this message | ||
Note Submitter: pizza23 at yahoo dot com
----
I needed a way to give the total time to execute a whole page of code that included MySQL code as
well and the exmples show did not quite help, Althought they lead me to the answer.
<?PHP
$starttimer = time()+microtime();
/*
...Page of Code
...MySQL Code
*/
$stoptimer = $time+microtime();
$timer = round($stoptimer-$starttimer,4);
echo "Page created in $timer seconds.";
?>
Result:
Page created in 4.1368 seconds.