如何测量 CakePHP 2.1 中的页面执行时间?
在 1.3 中,它在调试模式下呈现在代码中。
你可以使用调试工具包插件 https://github.com/cakephp/debug_kit找出执行时间。
或者您可以在 app/ 中编辑 index.php 并添加:
// top of file
$starTime = microtime(true);
// bottom of file
echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->';
该时间以微秒为单位,因此您可以根据需要将其转换为毫秒,但 DebugKit 为您提供了更多信息。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)