Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4fd5fc1

Browse filesBrowse files
committed
feature #3539 [Stopwatch] Describe retrieval of StopwatchEvent (jochenvdv)
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
2 parents c703549 + 0ee15d3 commit 4fd5fc1
Copy full SHA for 4fd5fc1

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎components/stopwatch.rst‎

Copy file name to clipboardExpand all lines: components/stopwatch.rst
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ microtime by yourself. Instead, use the simple
3131
// ... some code goes here
3232
$event = $stopwatch->stop('eventName');
3333

34+
.. versionadded:: 2.5
35+
The ``getEvent()`` method was introduced in Symfony 2.5
36+
37+
The :class:`Symfony\\Component\\Stopwatch\StopwatchEvent` object can be retrieved from the
38+
:method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`,
39+
:method:`Symfony\\Component\\Stopwatch\\Stopwatch::stop`,
40+
:method:`Symfony\\Component\\Stopwatch\\Stopwatch::lap` and
41+
:method:`Symfony\\Component\\Stopwatch\\Stopwatch::getEvent` methods.
42+
The latter should be used when you need to retrieve the duration of an event while it is still running.
43+
3444
You can also provide a category name to an event::
3545

3646
$stopwatch->start('eventName', 'categoryName');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.