PHP timing function

WBOY
Release: 2016-07-25 09:09:17
Original
2361 people have browsed it

//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


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template