PHP page load time


SUBMITTED BY: Guest

DATE: Oct. 23, 2013, 9:07 a.m.

FORMAT: PHP

SIZE: 434 Bytes

HITS: 1068

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

comments powered by Disqus