symfony/stopwatch

Provides a way to profile code

PHP

2,813

505 commits

updated Oct 3, 2026

See the code

README

Stopwatch Component

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');

This package is looking for a backer.

Help Symfony by sponsoring its development!

Resources

component
php
symfony
symfony-component

symfony/stopwatch

Provides a way to profile code

PHP

2,813

505 commits

updated Oct 3, 2026

See the code

README

Stopwatch Component

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');

This package is looking for a backer.

Help Symfony by sponsoring its development!

Resources

component
php
symfony
symfony-component

Project health

Overall

3.8/10

Maintained

5/10

Code review

0/10
OpenSSF Scorecard

Significant stargazers

Grégoire Pineau

812 followers · starred Dec 2017

Carl Schwan

114 followers · starred Jun 2018

Derick Rethans

1,840 followers · starred Feb 2021

Kyle

394 followers · starred Sep 2019