经测试代码如下:
/**
* 计算页面加载时间
*
* @param
* @arrange (512.笔记) jb51.cc
**/
$start = time();
// put a long operation in here
sleep(2);
$diff = time() - $start;
print "This page needed $diff seconds to load :-)";
// if you want a more exact value,you could use the
// microtime function
/*** 来自编程之家 jb51.cc(jb51.cc) ***/
原文链接:https://www.f2er.com/php/528957.html