Skip to content

Commit 65494c8

Browse files
committed
Merge pull request #2169 from johnkary/stopwatchFixes-1
Grammar and syntax cleanup for Stopwatch component
2 parents 6dbbb3c + 73d24f9 commit 65494c8

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

components/stopwatch.rst

+19-19
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ microtime by yourself. Instead, use the simple
3535
// ... some code goes here
3636
$event = $stopwatch->stop('eventName');
3737

38-
You also can provide a category name to an event::
38+
You can also provide a category name to an event::
3939

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

42-
You can consider categories as a way of tagging events. The Symfony Profiler
43-
tool, for example, uses categories to nicely color-code different events.
42+
You can consider categories as a way of tagging events. For example, the
43+
Symfony Profiler tool uses categories to nicely color-code different events.
4444

4545
Periods
4646
-------
4747

48-
As you know from the real world, all stopwatches come with two buttons.
49-
One for starting and stopping the stopwatch, another to measure the lap time.
50-
This is exactly what the :method:`Symfony\\Component\\Stopwatch\\Stopwatch::lap``
48+
As you know from the real world, all stopwatches come with two buttons:
49+
one to start and stop the stopwatch, and another to measure the lap time.
50+
This is exactly what the :method:``Symfony\\Component\\Stopwatch\\Stopwatch::lap``
5151
method does::
5252

5353
$stopwatch = new Stopwatch();
@@ -60,28 +60,28 @@ method does::
6060
// ... some other code goes here
6161
$event = $stopwatch->stop('foo');
6262

63-
Lap information is stored in periods within the event. To get lap information
64-
(aka periods) call::
63+
Lap information is stored as "periods" within the event. To get lap information
64+
call::
6565

6666
$event->getPeriods();
6767

68-
Besides getting periods, you can get other useful information from the event object.
68+
In addition to periods, you can get other useful information from the event object.
6969
For example::
7070

71-
$event->getCategory(); // Returns the category the evenent was started in
72-
$event->getOrigin(); // Returns the start time of the Event in milliseconds
73-
$event->ensureStopped(); // Stops all not-already-stopped periods
74-
$event->getStartTime(); // Returns the start of the very first period
71+
$event->getCategory(); // Returns the category the event was started in
72+
$event->getOrigin(); // Returns the event start time in milliseconds
73+
$event->ensureStopped(); // Stops all periods not already stopped
74+
$event->getStartTime(); // Returns the start time of the very first period
7575
$event->getEndTime(); // Returns the end time of the very last period
76-
$event->getDuration(); // Gets the duration (including all periods) of the event
77-
$event->getMemory(); // Gets the max memory usage of all periods
76+
$event->getDuration(); // Returns the event duration, including all periods
77+
$event->getMemory(); // Returns the max memory usage of all periods
7878

7979
Sections
8080
--------
8181

8282
Sections are a way to logically split the timeline into groups. You can see
83-
how Symfony uses sections to nicely visualize framework lifecycle in the
84-
Symfony Profiler tool. Here is a basic usage of sections::
83+
how Symfony uses sections to nicely visualize the framework lifecycle in the
84+
Symfony Profiler tool. Here is a basic usage example using sections::
8585

8686
$stopwatch = new Stopwatch();
8787

@@ -91,8 +91,8 @@ Symfony Profiler tool. Here is a basic usage of sections::
9191

9292
$events = $stopwatch->getSectionEvents('routing');
9393

94-
You can reopen a closed section by calling the openSection method and specifying
95-
an id of the section to be reopened::
94+
You can reopen a closed section by calling the :method:``Symfony\\Component\\Stopwatch\\Stopwatch::openSection``
95+
method and specifying the id of the section to be reopened::
9696

9797
$stopwatch->openSection('routing');
9898
$stopwatch->start('building_config_tree');

0 commit comments

Comments
 (0)