Time CakePHP 2.1测量页面执行时间

Time CakePHP 2.1测量页面执行时间,time,execution,cakephp-1.2,Time,Execution,Cakephp 1.2,在CakePHP2.1中,如何度量页面执行时间? 在1.3中,它是在调试模式下在代码中呈现的。您可以使用它来查找执行时间 或者,您可以在app/中编辑index.php并添加: // top of file $starTime = microtime(true); // bottom of file echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->'; //文件顶部 $starTime=microtime(真)

在CakePHP2.1中,如何度量页面执行时间? 在1.3中,它是在调试模式下在代码中呈现的。

您可以使用它来查找执行时间

或者,您可以在app/中编辑index.php并添加:

// top of file
$starTime = microtime(true);
// bottom of file
echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->';
//文件顶部
$starTime=microtime(真);
//文件的底部
回声';

该时间将以微秒为单位,因此您可以根据需要将其转换为毫秒,但DebugKit提供了更多信息。

请注意,根据文档,从微秒返回的时间实际上以秒为单位,而不是微秒