<?php 
//Create a variable for start time - it needs to be the very first line of your web page
$time_start = microtime(true); 
?>
your web page code goes here
<?php
//Create a variable for end time - this needs to be at the end of the web page when everything else is loaded
$time_end = microtime(true); 
 
$time = $time_end - $time_start; 
 
echo 'Page took '.$time.' seconds to execute'; 
?>