Posted By

ZaiSL on 09/26/10


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

echo419r
mikael12
mmcachran


Calculate execution time


 / Published in: PHP
 

URL: http://phpsnips.com/snippet.php?id=26

  1. //Create a variable for start time
  2. $time_start = microtime(true);
  3.  
  4. // Place your PHP/HTML/JavaScript/CSS/Etc. Here
  5.  
  6. //Create a variable for end time
  7. $time_end = microtime(true);
  8. //Subtract the two times to get seconds
  9. $time = $time_end - $time_start;
  10.  
  11. echo 'Script took '.$time.' seconds to execute';

Report this snippet  

You need to login to post a comment.