Skip to content

Commit 7c1178c

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Added documentation for __toString feature in StopWatch event
2 parents 6c6e0c4 + f7a7ff2 commit 7c1178c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/stopwatch.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ time of certain parts of code so that you don't constantly have to parse
2727
use Symfony\Component\Stopwatch\Stopwatch;
2828

2929
$stopwatch = new Stopwatch();
30+
3031
// starts event named 'eventName'
3132
$stopwatch->start('eventName');
32-
// ... some code goes here
33+
34+
// ... run your code here
35+
3336
$event = $stopwatch->stop('eventName');
37+
// you can convert $event into a string for a quick summary
38+
// e.g. (string) $event = '4.50 MiB - 26 ms'
3439

3540
The :class:`Symfony\\Component\\Stopwatch\\StopwatchEvent` object can be retrieved
3641
from the :method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`,

0 commit comments

Comments
 (0)