1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
/*
@ 计算php程序运行时间
*/
functionmicrotime_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;
?>

转载请注明来源:php计算一个页面执行时间函数写法

  哈尔滨品用软件有限公司致力于为哈尔滨的中小企业制作大气、美观的优秀网站,并且能够搭建符合百度排名规范的网站基底,使您的网站无需额外费用,即可稳步提升排名至首页。欢迎体验最佳的哈尔滨网站建设