(PHP) Page created in 'x' seconds with 'y' queries.
#9

At the top of your script, put something like this:

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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)