CakePHP 2.1 Measuring Page Runtime

How to measure page runtime in CakePHP 2.1? In 1.3, it was displayed in code in debug mode.

+3
source share
2 answers

You can use DebugKit Plugin to find out the runtime.

Or you can edit index.php in the / application and add:

// top of file
$starTime = microtime(true);
// bottom of file
echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->';

This time will be in microseconds so you can convert it to ms if you want, but DebugKit gives you much more information.

+3
source

Note that the time returned from microtime is actually in seconds, not microseconds, according to the docs.

0
source

All Articles