@@ -34,13 +34,24 @@ microtime by yourself. Instead, use the simple
3434 $event = $stopwatch->stop('eventName');
3535
3636The :class: `Symfony\\ Component\\ Stopwatch\\ StopwatchEvent ` object can be retrieved
37- from the :method: `Symfony\\ Component\\ Stopwatch\\ Stopwatch::start `,
38- :method: `Symfony\\ Component\\ Stopwatch\\ Stopwatch::stop `,
39- :method: `Symfony\\ Component\\ Stopwatch\\ Stopwatch::lap ` and
40- :method: `Symfony\\ Component\\ Stopwatch\\ Stopwatch::getEvent ` methods.
37+ from the :method: `Symfony\\ Component\\ Stopwatch\\ Stopwatch::start `,
38+ :method: `Symfony\\ Component\\ Stopwatch\\ Stopwatch::stop `,
39+ :method: `Symfony\\ Component\\ Stopwatch\\ Stopwatch::lap ` and
40+ :method: `Symfony\\ Component\\ Stopwatch\\ Stopwatch::getEvent ` methods.
4141The latter should be used when you need to retrieve the duration of an event
4242while it is still running.
4343
44+ .. tip ::
45+
46+ By default, the stopwatch truncates any sub-millisecond time measure to ``0 ``,
47+ so you can't measure microseconds or nanoseconds. If you need more precision,
48+ pass ``true `` to the ``Stopwatch `` class constructor to enable full precision::
49+
50+ $stopwatch = new Stopwatch(true);
51+
52+ .. versionadded :: 3.4
53+ The full precision feature was introduced in Symfony 3.4.
54+
4455You can also provide a category name to an event::
4556
4657 $stopwatch->start('eventName', 'categoryName');
0 commit comments