Permalink
Browse files

feature #3539 [Stopwatch] Describe retrieval of StopwatchEvent (joche…

…nvdv)

This PR was merged into the master branch.

Discussion
----------

[Stopwatch] Describe retrieval of StopwatchEvent

See [symfony/symfony#10198](symfony/symfony#10198)

| Q | A |
|----------------|------|
| Doc fix | no |
| New docs | yes |
| Applies to | master |
| Fixed tickets | - |

Commits
-------

0ee15d3 Fix versionadded
295f109 Add reason for getEvent()
ac484f4 Made suggested tweaks
2ca9bd5 Describe retrieval of StopwatchEvent
  • Loading branch information...
weaverryan committed Mar 26, 2014
2 parents c703549 + 0ee15d3 commit 4fd5fc16c6225ed817402e39d10ca471d934d877
Showing with 10 additions and 0 deletions.
  1. +10 −0 components/stopwatch.rst
View
@@ -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');

0 comments on commit 4fd5fc1

Please sign in to comment.