Home > php教程 > php手册 > 计算php页面运行时间的函数介绍

计算php页面运行时间的函数介绍

WBOY
Release: 2016-06-06 20:28:44
Original
1273 people have browsed it

本篇文章是对计算php页面运行时间的函数进行了详细的分析介绍,需要的朋友参考下

一个计算php页面运行时间的函数。

复制代码 代码如下:


/*
@ 计算php程序运行时间
*/
function microtime_float()
{
list($usec, $sec) = explode(” “, microtime());
return ((float)$usec + (float)$sec);
}
//开始计时,虚拟主机,美国空间,放在头部
$starttime = microtime_float();
//结束计时,放在最底部
$runtime = number_format((microtime_float() – $starttime), 4).'s';
//输出
echo ‘RunTime:'.$runtime;
?>

,美国空间
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template