diff --git a/_build/redirection_map b/_build/redirection_map index 3ebfecff681..3ce81114179 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -190,6 +190,7 @@ /cookbook/profiler/matchers /profiler/matchers /cookbook/profiler/profiling_data /profiler/profiling_data /cookbook/profiler/storage /profiler/storage +/cookbook/profiler/stopwatch /profiler/stopwatch /cookbook/psr7 /components/psr7 /cookbook/request/index /request /cookbook/request/load_balancer_reverse_proxy /deployment/proxies diff --git a/profiler/stopwatch.rst b/profiler/stopwatch.rst new file mode 100644 index 00000000000..8c02e77f403 --- /dev/null +++ b/profiler/stopwatch.rst @@ -0,0 +1,17 @@ +.. index:: + single: Profiling; Stopwatch + +How to show custom timing +========================= + +Inject :class:`Symfony\\Component\\Stopwatch\\Stopwatch` by autowiring. Or do ``$stopwatch = $this->get('debug.stopwatch');`` in a Controller. + +All timing mesurements done by this stopwatch are shown in the profiler on the page performance. + +short example:: + + $stopwatch->start('anEvent', 'customCategory'); + $stopwatch->lapse('anEvent'); + $stopwatch->stop('anEvent'); + +:doc:`/components/stopwatch` explains the methods in more details.