Skip to content

Commit

Permalink
feature #3539 [Stopwatch] Describe retrieval of StopwatchEvent (joche…
Browse files Browse the repository at this point in the history
…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 4fd5fc1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/stopwatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 4fd5fc1

Please sign in to comment.