Skip to content

Commit bf76aba

Browse files
committed
minor #13311 Added documentation for __toString feature in StopWatch event (zf2timo)
This PR was squashed before being merged into the 3.4 branch (closes #13311). Discussion ---------- Added documentation for __toString feature in StopWatch event I noticed there is no documentation about using the `__toString` method of the StopWatch Event. So here is it. Commits ------- 1d85ccb Added documentation for __toString feature in StopWatch event
2 parents 844dd8a + 1d85ccb commit bf76aba

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

components/stopwatch.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,16 @@ method and specifying the id of the section to be reopened::
120120
$stopwatch->openSection('routing');
121121
$stopwatch->start('building_config_tree');
122122
$stopwatch->stopSection('routing');
123+
124+
125+
Printing a Summary
126+
------------------
127+
128+
The event can easily be printed to display a summary::
129+
130+
$stopwatch = new Stopwatch();
131+
$stopwatch->start();
132+
// ... do some work here
133+
$output->writeln($stopwatch->stop()); // prints something like default: 14.00 MiB - 2056 ms
134+
135+
This gives you a brief summary of the used memory an elapsed time.

0 commit comments

Comments
 (0)