Скорость исполнения скриптов(action) yii2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
public function afterAction($action, $result) { parent::afterAction($action, $result); $this->output[] = [ $action->id, number_format(Yii::$app->log->logger->elapsedTime, 2) ]; } public function __destruct() { if ($this->interactive && $this->output) { $msg = Table::widget([ 'headers' => ['Action', 'Time(sec.)'], 'rows' => $this->output, ]); $this->stdout($msg, Console::FG_GREEN); } } |
Yii2 execution time script console