generation time

hello all,

does yii has some type of helper to show total time spent by all modules to output the page to webbrowser?

none of a kind???

ok. may be anybody can tell how to do it in php? should i start counting time in index.php? and stop counting in view? so i should add code in every view?

ok. found the solution. to do this one should put this code to main.php layout




ExecutionTime: <?=round(Yii::getLogger()->executionTime, 3); ?>;

MemoryUsage: <?=round(Yii::getLogger()->memoryUsage/1024/1024, 3)." MB"; ?>;






<?php

echo 'Page generated in ' . round((microtime(TRUE) - YII_BEGIN_TIME), 4) . ' seconds using ' . round(memory_get_peak_usage(true) / 1048576, 2) . ' MB of memory!';

?>



Keeping it in footer of the main layout isn’t a bad idea but there are things that are called even after the layout is parsed. Maybe beforeAction() method in Controller class from which all other controllers extend, is the right place.