PHP obtains the script running time. Header (content-type: texthtml; charsetutf-8); microtime-returns the current Unix timestamp and number of microseconds $ oldtimemicrotime (true); echo the script running time:; $ v0; for ($ I
Header ("content-type: text/html; charset = utf-8 ");
// Microtime-returns the current Unix timestamp and number of microseconds
$ Oldtime = microtime (true );
Echo "the script running time is :";
$ V = 0;
For ($ I = 0; I I <100; $ I ++ ){
$ V ++;
}
$ Newtime = microtime (true );
// Obtain the time difference
$ Runtime = $ newtime-$ oldtime;
// Change the timestamp to a string-var_export output or return a string representation of a variable
$ Runtime = var_export ($ runtime );
// Truncates the string substr_count to calculate the number of times the string appears
$ Postion = substr_count ($ runtime, 'E ');
$ Runtime = substr ($ runtime, 0, $ postion-1 );
// Convert the string value to floatfloatval-get the floating point value of the variable
$ Running time = floatval ($ runtime)/1000;
Echo $ runtime. "seconds ";
?>
Http://www.bkjia.com/PHPjc/742404.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/742404.htmlTechArticleheader ("content-type: text/html; charset = utf-8"); // microtime-returns the current Unix timestamp and microseconds $ oldtime = microtime (true ); echo "the script running time is:"; $ v = 0; for ($ I...