我如何在CakePHP 2.1中测量页面执行时间?在1.3中,当处于调试模式时,代码会呈现出来。
您可以使用DebugKit插件来查找执行时间。
或者您可以编辑app/中的index.php并添加:
// top of file
$starTime = microtime(true);
// bottom of file
echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->';
那个时间将以微秒为单位,如果需要,您可以将其转换为毫秒,但DebugKit会提供更多的信息。