If you want to add a feature to your website that shows the loading time of the page just impliment the code below.

Offcourse php is a serverside language so the result is the time needed to generate the html on the server. This does not include sending the page back to the browsers who has to render it. But it's quite accurate.

PHP:
  1. // in the beginning of the page
  2. $start_time = explode(' ', microtime());
  3. $start_time = $start_time[1] + $start_time[0];
  4.  
  5. // at the end of the page
  6. $end_time = explode(' ', microtime());
  7. $total_time = $end_time[0] + $end_time[1] - $start_time;
  8. printf('Page loaded in  %.3f seconds.', $total_time);