Home >Backend Development >PHP Tutorial >PHP timing function

PHP timing function

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-25 09:09:172398browse

//Function: timing function
//Usage: Echo Runtime(1);
  1. //Function: Timing function
  2. //Usage: Echo Runtime(1);
  3. Function Runtime($mode=0){
  4. Static $s;
  5. IF(!$mode){
  6. $s=microtime ();
  7. Return;
  8. }
  9. $e=microtime();
  10. $s=Explode(" ", $s);
  11. $e=Explode(" ", $e);
  12. Return Sprintf("%.2f ms",($e[1]+$e[0]-$s[1]-$s[0])*1000);
  13. }
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php referenceNext article:php reference