02.09.2012, 11:04
At the top of your script, put something like this:
Then for every one of your queries, increment $pageexec_query like this:
Then at the end of your script, put this bit that reports the execution time and the number of queries used:
Код:
<?php $pageexec_time = microtime(true); // this will return a floating point Unix timestamp with milliseconds included $pageexec_queries = 0; ?>
Код:
<?php mysqli_query($whatever); $pageexec_queries++; ?>
Код:
<?php echo "<p>Page created in ".(microtime(true)-$pageexec_time)." seconds with $pageexec_queries queries.</p>"; ?>