class StopwatchEvent
Represents an Event managed by Stopwatch.
| __construct(float $origin, string $category = null, bool $morePrecision = false) | ||
| string | getCategory() Gets the category. | |
| float | getOrigin() Gets the origin. | |
| $this | start() Starts a new event period. | |
| $this | stop() Stops the last started event period. | |
| bool | isStarted() Checks if the event was started. | |
| $this | lap() Stops the current period and then starts a new one. | |
| ensureStopped() Stops all non already stopped periods. | ||
| StopwatchPeriod[] | getPeriods() Gets all event periods. | |
| int|float | getStartTime() Gets the relative time of the start of the first period. | |
| int|float | getEndTime() Gets the relative time of the end of the last period. | |
| int|float | getDuration() Gets the duration of the events (including all periods). | |
| int | getMemory() Gets the max memory usage of all periods. | |
| float | getNow() Return the current time relative to origin. | |
| string | __toString() |
| float | $origin | The origin time in milliseconds |
| string | $category | The event category or null to use the default |
| bool | $morePrecision | If true, time is stored as float to keep the original microsecond precision |
| InvalidArgumentException | When the raw time is not valid |
Gets the category.
| string | The category |
Gets the origin.
| float | The origin in milliseconds |
Starts a new event period.
| $this |
Stops the last started event period.
| $this |
| LogicException | When stop() is called without a matching call to start() |
Checks if the event was started.
| bool |
Stops the current period and then starts a new one.
| $this |
Stops all non already stopped periods.
Gets all event periods.
| StopwatchPeriod[] | An array of StopwatchPeriod instances |
Gets the relative time of the start of the first period.
| int|float | The time (in milliseconds) |
Gets the relative time of the end of the last period.
| int|float | The time (in milliseconds) |
Gets the duration of the events (including all periods).
| int|float | The duration (in milliseconds) |
Gets the max memory usage of all periods.
| int | The memory usage (in bytes) |
Return the current time relative to origin.
| float | Time in ms |
| string |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Stopwatch/StopwatchEvent.html