3
如何測量CakePHP 2.1中的頁面執行時間? 1.3版在調試模式下呈現在代碼中。CakePHP 2.1測量頁面執行時間
如何測量CakePHP 2.1中的頁面執行時間? 1.3版在調試模式下呈現在代碼中。CakePHP 2.1測量頁面執行時間
您可以使用DebugKit Plugin找出執行時間。
或者你可以在應用中編輯index.php文件/添加:
// top of file
$starTime = microtime(true);
// bottom of file
echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->';
到時候會在幾微秒,所以你可以,如果你想將其轉換爲毫秒,但DebugKit爲您提供了更多的信息。
請注意,根據文檔,從microtime返回的時間實際上是幾秒而不是幾微秒。