Stopwatch (Component\Stopwatch)
Symfony\Component\Stopwatch\Stopwatch
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
public __construct()
public Section[] getSections()
public openSection(string|null $id = null)
Creates a new section or re-opens an existing section.
public stopSection(string $id)
Stops the last started section.
The id parameter is used to retrieve the events from this section.
public StopwatchEvent start(string $name, string $category = null)
Starts an event.
public bool isStarted(string $name)
Checks if the event was started.
public StopwatchEvent stop(string $name)
Stops an event.
public StopwatchEvent lap(string $name)
Stops then restarts an event.
public StopwatchEvent getEvent(string $name)
Returns a specific event by name.
public StopwatchEvent[] getSectionEvents(string $id)
Gets all events for a given section.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Stopwatch/Stopwatch.html