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