Guest

Sam Yong

By: a guest on Sep 4th, 2009  |  syntax: PHP  |  size: 0.66 KB  |  hits: 131  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  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. ?>