StopwatchEvent::getMemory()

int getMemory() Gets the max memory usage of all periods. Return Value int The memory usage (in bytes)

StopwatchEvent::getPeriods()

StopwatchPeriod[] getPeriods() Gets all event periods. Return Value StopwatchPeriod[] An array of StopwatchPeriod instances

StopwatchEvent::ensureStopped()

ensureStopped() Stops all non already stopped periods.

StopwatchEvent

class StopwatchEvent Represents an Event managed by Stopwatch. Methods __construct(float $origin, string|null $category = null) Constructor. string getCategory() Gets the category. float getOrigin() Gets the origin. StopwatchEvent start() Starts a new event period. StopwatchEvent stop() Stops the last started event period. bool isStarted() Checks if the event was started. StopwatchEvent lap() Stops the current period and then starts a new one. ensureSto

StopwatchEvent::getDuration()

int getDuration() Gets the duration of the events (including all periods). Return Value int The duration (in milliseconds)

StopwatchEvent::getCategory()

string getCategory() Gets the category. Return Value string The category

Stopwatch::stopSection()

stopSection(string $id) Stops the last started section. The id parameter is used to retrieve the events from this section. Parameters string $id The identifier of the section Exceptions LogicException When there's no started section to be stopped See also getSectionEvents()

Stopwatch::start()

StopwatchEvent start(string $name, string $category = null) Starts an event. Parameters string $name The event name string $category The event category Return Value StopwatchEvent A StopwatchEvent instance

Stopwatch::stop()

StopwatchEvent stop(string $name) Stops an event. Parameters string $name The event name Return Value StopwatchEvent A StopwatchEvent instance

Stopwatch::openSection()

openSection(string|null $id = null) Creates a new section or re-opens an existing section. Parameters string|null $id The id of the session to re-open, null to create a new one Exceptions LogicException When the section to re-open is not reachable