Search by

symfony / stopwatch

fabpot

Provides a way to profile code

Package info

github.com/symfony/stopwatch

Homepage

pkg:composer/symfony/stopwatch

Statistics

Installs: 457 994 641

Dependents: 1 020

Suggesters: 69

Stars: 2 812

v8.2.0-BETA1 2026-10-03 08:17 UTC

This package is auto-updated.

Last update: 2026-11-04 12:37:13 UTC


README

The Stopwatch component provides a way to profile code.

Getting Started

composer require symfony/stopwatch
use Symfony\Component\Stopwatch\Stopwatch;

$stopwatch = new Stopwatch();

// optionally group events into sections (e.g. phases of the execution)
$stopwatch->openSection();

// starts event named 'eventName'
$stopwatch->start('eventName');

// ... run your code here

// optionally, start a new "lap" time
$stopwatch->lap('foo');

// ... run your code here

$event = $stopwatch->stop('eventName');

$stopwatch->stopSection('phase_1');

Sponsor

This package is looking for a backer.

Help Symfony by sponsoring its development!

Resources