更多细节Symfony3 Profiler

时间:2017-07-19 11:54:47

标签: symfony

我有来自Symfony的输出;

控制器耗时最长,但如何才能更准确地了解耗时最长的功能?

enter image description here

1 个答案:

答案 0 :(得分:2)

您可以使用Stopwatch component

public function bottleNeckAction()
{
    $stopwatch = $this->get('debug.stopwatch');

    $stopwatch->start('someServiceCall');
    $this->someServiceCall();
    $stopwatch->stop('someServiceCall');

    //…
}