CodeIgniter(3.1.4)框架中添加,执行时间统计代码:
system/core/CodeIgniter.php最后行处。
/*
* ------------------------------------------------------
* custom code snippet.
* ------------------------------------------------------
*
* Statistic run time.
*
*/
p($BM->marker);
p('total_execution_time: ' . $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end') . ' SEC');
p('loading_time: ' . $BM->elapsed_time('loading_time:_base_classes_start', 'loading_time:_base_classes_end') . ' SEC');
p('controller_execution_time_( '.$class.' / '.$method.' )_time: '
. $BM->elapsed_time('controller_execution_time_( '.$class.' / '.$method.' )_start'
, 'controller_execution_time_( '.$class.' / '.$method.' )_end') . ' SEC');