Skip to content

Commit f493a42

Browse files
committed
minor #15870 [Stopwatch] Documenting the __root__ section (ThomasLandauer)
This PR was merged into the 4.4 branch. Discussion ---------- [Stopwatch] Documenting the __root__ section Finally closes the (already closed) #13987 The info is taken from `@stof` at symfony/symfony#37630 (comment) Commits ------- 6ffd199 Documenting the __root__ section
2 parents 12c52de + 6ffd199 commit f493a42

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

performance.rst

+9
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,15 @@ Sections are a way to split the profile timeline into groups. Example::
330330
$this->stopwatch->start('processing-file');
331331
$this->stopwatch->stopSection('parsing');
332332

333+
All events that don't belong to any named section are added to the special section
334+
``__root__``. This way you can get all stopwatch events, even if you don't know
335+
their names::
336+
337+
foreach($this->stopwatch->getSectionEvents('__root__') as $event) {
338+
echo (string) $event;
339+
}
340+
341+
333342
Learn more
334343
----------
335344

0 commit comments

Comments
 (0)