In this script, I will show you how to get the execution time of a script an to display it.
This script is very simple, we will get the micro-seconds in the beginning and in the and of the script using the microtime function of PHP. Then, we will do a subtraction to get the elapsed time during the script execution.
This is the code to use:
$time = explode(' ', microtime());
$beginning = timer();
<!-- The content of your page -->
Page generated in <?php echo round(timer()-$beginning,6); ?> seconds.
I hope this script will be useful.
Similar Scripts and Tutorials