一个计算php页面运行时间的函数。
<?php
/*
@ 计算php程序运行时间
@ www.jbxue.com
*/
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;
?>

 

相关文章:

  • 2022-12-23
  • 2021-07-11
  • 2021-12-24
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
猜你喜欢
  • 2022-12-23
  • 2022-02-01
  • 2021-12-15
  • 2021-11-08
  • 2022-12-23
相关资源
相似解决方案