A function that calculates the running time of a php page.
Copy code The code is as follows:
/*
@ Calculate php Program running time
*/
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$ usec + (float)$sec);
}
//Start timing and place it at the top
$starttime = microtime_float();
//End timing and place it at the bottom
$runtime = number_format((microtime_float() – $starttime), 4).'s';
//Output
echo 'RunTime:'.$runtime;
?>
http://www.bkjia.com/PHPjc/327955.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327955.htmlTechArticleA function that calculates the running time of a php page. Copy the code as follows: ?php /* @ Calculate the running time of the php program*/ function microtime_float() { list($usec, $sec) = explode(" ",...
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