Posted By

res_328774 on 09/14/09


Tagged

time debug


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

mjnbrn
BrianCoyDesign
joethermal


PHP Load Time


 / Published in: PHP
 

URL: http://www.hulldo.co.uk/web/tutorial/php_load_time/#tutorial

  1. <?php
  2. // code for TOP of the page
  3. $start = microtime();
  4. $startarray = explode(" ", $start);
  5. $start = $startarray[1] + $startarray[0];
  6. ?>
  7.  
  8. <?php
  9. // code for BOTTOM of the page
  10. $end = microtime();
  11. $endarray = explode(" ", $end);
  12. $end = $endarray[1] + $endarray[0];
  13. $total = $end - $start;
  14. $total = round($total,2);
  15. echo $total." seconds</a>";
  16. ?>

Report this snippet  

You need to login to post a comment.