Introduction to functions for calculating PHP page running time_PHP tutorial

WBOY
Release: 2016-07-21 15:01:56
Original
711 people have browsed it

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;
?>

www.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(" ",...
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