8000 Added documentation for __toString feature in StopWatch event · symfony/symfony-docs@1d85ccb · GitHub
[go: up one dir, main page]

Skip to content

Commit 1d85ccb

Browse files
Timo Tewesjaviereguiluz
Timo Tewes
authored andcommitted
Added documentation for __toString feature in StopWatch event
1 parent c8df8e4 commit 1d85ccb

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)
0