class Stopwatch
Stopwatch provides a way to profile code.
Methods
__construct() | ||
Section[] | getSections() | |
openSection(string|null $id = null) Creates a new section or re-opens an existing section. | ||
stopSection(string $id) Stops the last started section. | ||
StopwatchEvent | start(string $name, string $category = null) Starts an event. | |
bool | isStarted(string $name) Checks if the event was started. | |
StopwatchEvent | stop(string $name) Stops an event. | |
StopwatchEvent | lap(string $name) Stops then restarts an event. | |
StopwatchEvent | getEvent(string $name) Returns a specific event by name. | |
StopwatchEvent[] | getSectionEvents(string $id) Gets all events for a given section. |
Details
__construct()
Section[] getSections()
openSection(string|null $id = null)
Creates a new section or re-opens an existing section.
stopSection(string $id)
Stops the last started section.
The id parameter is used to retrieve the events from this section.
StopwatchEvent start(string $name, string $category = null)
Starts an event.
bool isStarted(string $name)
Checks if the event was started.
StopwatchEvent stop(string $name)
Stops an event.
StopwatchEvent lap(string $name)
Stops then restarts an event.
StopwatchEvent getEvent(string $name)
Returns a specific event by name.
StopwatchEvent[] getSectionEvents(string $id)
Gets all events for a given section.
Please login to continue.