\app\framework\Component\StopwatchStopwatch

Stopwatch provides a way to profile code.

Summary

Methods
Properties
Constants
__construct()
getSections()
openSection()
stopSection()
start()
isStarted()
stop()
lap()
getEvent()
getSectionEvents()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$sections
$activeSections
N/A

Properties

Methods

__construct()

__construct() 

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

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

LogicException When there's no started section to be stopped

start()

start(string  $name, string  $category = null) : \app\framework\Component\Stopwatch\StopwatchEvent

Starts an event.

Parameters

string $name

The event name

string $category

The event category

Returns

\app\framework\Component\Stopwatch\StopwatchEvent

isStarted()

isStarted(string  $name) : boolean

Checks if the event was started.

Parameters

string $name

The event name

Returns

boolean

getSectionEvents()

getSectionEvents(string  $id) : array<mixed,\app\framework\Component\Stopwatch\StopwatchEvent>

Gets all events for a given section.

Parameters

string $id

A section identifier

Returns

array<mixed,\app\framework\Component\Stopwatch\StopwatchEvent>