johnmahugu

php - time to load

Jun 14th, 2015
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. /** check time execution eg page load */
  2.  
  3. $start = time();
  4.  
  5. // put a long operation in here
  6. sleep(2);
  7.  
  8.  
  9. $diff = time() - $start;
  10.  
  11. print "This page needed $diff seconds to load :-)";
  12.  
  13. // if you want a more exact value, you could use the
  14. // microtime function
Advertisement
Add Comment
Please, Sign In to add comment