File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
src/Symfony/Component/Stopwatch Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,39 @@ Stopwatch Component
3
3
4
4
The Stopwatch component provides a way to profile code.
5
5
6
+ Getting Started
7
+ ---------------
8
+
9
+ ```
10
+ $ composer require symfony/stopwatch
11
+ ```
12
+
13
+ ``` php
14
+ use Symfony\Component\Stopwatch\Stopwatch;
15
+
16
+ $stopwatch = new Stopwatch();
17
+
18
+ // optionally group events into sections (e.g. phases of the execution)
19
+ $stopwatch->openSection();
20
+
21
+ // starts event named 'eventName'
22
+ $stopwatch->start('eventName');
23
+
24
+ // ... run your code here
25
+
26
+ // optionally, start a new "lap" time
27
+ $stopwatch->lap('foo');
28
+
29
+ // ... run your code here
30
+
31
+ $event = $stopwatch->stop('eventName');
32
+
33
+ $stopwatch->stopSection('phase_1');
34
+ ```
35
+
6
36
Resources
7
37
---------
8
38
9
- * [ Documentation] ( https://symfony.com/doc/current/components/stopwatch.html )
10
39
* [ Contributing] ( https://symfony.com/doc/current/contributing/index.html )
11
40
* [ Report issues] ( https://github.com/symfony/symfony/issues ) and
12
41
[ send Pull Requests] ( https://github.com/symfony/symfony/pulls )
You can’t perform that action at this time.
0 commit comments