Class Symfony\Component\Stopwatch\Stopwatch

InheritanceSymfony\Component\Stopwatch\Stopwatch

Stopwatch provides a way to profile code.

Method Details

__construct() public method

public void __construct ( )
getEvent() public method

Returns a specific event by name.

public Symfony\Component\Stopwatch\StopwatchEvent getEvent ( $name )
$name string

The event name

return Symfony\Component\Stopwatch\StopwatchEvent

A StopwatchEvent instance

getSectionEvents() public method

Gets all events for a given section.

public Symfony\Component\Stopwatch\StopwatchEvent[] getSectionEvents ( $id )
$id string

A section identifier

return Symfony\Component\Stopwatch\StopwatchEvent[]

An array of StopwatchEvent instances

getSections() public method

public Symfony\Component\Stopwatch\Section[] getSections ( )
isStarted() public method

Checks if the event was started.

public bool isStarted ( $name )
$name string

The event name

lap() public method

Stops then restarts an event.

public Symfony\Component\Stopwatch\StopwatchEvent lap ( $name )
$name string

The event name

return Symfony\Component\Stopwatch\StopwatchEvent

A StopwatchEvent instance

openSection() public method

Creates a new section or re-opens an existing section.

public void openSection ( $id null )
$id string|null

The id of the session to re-open, null to create a new one

throws LogicException

When the section to re-open is not reachable

start() public method

Starts an event.

public Symfony\Component\Stopwatch\StopwatchEvent start ( $name, $category null )
$name string

The event name

$category string

The event category

return Symfony\Component\Stopwatch\StopwatchEvent

A StopwatchEvent instance

stop() public method

Stops an event.

public Symfony\Component\Stopwatch\StopwatchEvent stop ( $name )
$name string

The event name

return Symfony\Component\Stopwatch\StopwatchEvent

A StopwatchEvent instance

stopSection() public method

Stops the last started section.

The id parameter is used to retrieve the events from this section.

See also getSectionEvents().

public void stopSection ( $id )
$id string

The identifier of the section

throws LogicException

When there's no started section to be stopped