如何测量 CakePHP 2.1 中的页面执行时间? 在 1.3 中,它在 Debug模式下呈现在代码中。
最佳答案
你可以使用 DebugKit Plugin找出执行时间。
或者你可以在 app/中编辑 index.php 并添加:
// top of file
$starTime = microtime(true);
// bottom of file
echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->';
该时间将以微秒为单位,因此您可以根据需要将其转换为毫秒,但 DebugKit 会为您提供更多信息。
关于time - CakePHP 2.1 测量页面执行时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10243141/