diff --git a/components/stopwatch.rst b/components/stopwatch.rst index c3ebd41031d..862b8808c84 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -48,6 +48,17 @@ You can also provide a category name to an event:: You can consider categories as a way of tagging events. For example, the Symfony Profiler tool uses categories to nicely color-code different events. +Usage in symfony +---------------- + +In a Controller, do:: + + $stopwatch = $this->get('debug.stopwatch'); + $stopwatch->start('anEvent'); + +Or inject :class:`Symfony\\Component\\Stopwatch\\Stopwatch` by autowiring. +Thereafter this timing can be seen in the profiler. + Periods -------