Guest
Public paste!

Sam Yong

By: a guest | Sep 4th, 2009 | Syntax: PHP | Size: 0.66 KB | Hits: 129 | Expires: Never
Copy text to clipboard
  1. <?php
  2.  
  3. $time_start = microtime_float();
  4. $test = cool;
  5. echo $test.'<br/>';
  6. $time_end = microtime_float();
  7. $loadedin = (float)($time_end - $time_start);
  8. echo $loadedin.' s<br/>';
  9.  
  10. $time_start = microtime_float();
  11. $test = "cool";
  12. echo $test.'<br/>';
  13. $time_end = microtime_float();
  14. $loadedin = (float)($time_end - $time_start);
  15. echo $loadedin.' s<br/>';
  16.  
  17. $time_start = microtime_float();
  18. $test = 'cool';
  19. echo $test.'<br/>';
  20. $time_end = microtime_float();
  21. $loadedin = (float)($time_end - $time_start);
  22. echo $loadedin.' s<br/>';
  23.  
  24. function microtime_float(){
  25.     list($usec, $sec) = explode(" ", microtime());
  26.     return ((float)$usec + (float)$sec);
  27. }
  28.  
  29. ?>