Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CakePHP 2.1 Measuring Page Execution Time

How can I Measure the Page Execution Time in CakePHP 2.1? In 1.3 it was rendered in the code when in debug mode.

like image 599
waterschaats Avatar asked Dec 12 '25 16:12

waterschaats


1 Answers

You could use DebugKit Plugin to find out execution time.

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

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

That time will be in microseconds so you could convert it to ms if you want, but DebugKit gives you a lot more information.

like image 100
tigrang Avatar answered Dec 15 '25 11:12

tigrang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!