diff --git a/components/stopwatch.rst b/components/stopwatch.rst index 2598bdb3cd0..324539f3cf6 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -31,6 +31,16 @@ microtime by yourself. Instead, use the simple // ... some code goes here $event = $stopwatch->stop('eventName'); +.. versionadded:: 2.5 + The ``getEvent()`` method was introduced in Symfony 2.5 + +The :class:`Symfony\\Component\\Stopwatch\StopwatchEvent` object can be retrieved from the +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`, +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::stop`, +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::lap` and +:method:`Symfony\\Component\\Stopwatch\\Stopwatch::getEvent` methods. +The latter should be used when you need to retrieve the duration of an event while it is still running. + You can also provide a category name to an event:: $stopwatch->start('eventName', 'categoryName');