symfony / stopwatch
Provides a way to profile code
v8.1.0
2026-05-29 05:06 UTC
Requires
- php: >=8.4.1
- symfony/service-contracts: ^2.5|^3
This package is auto-updated.
Last update: 2026-06-05 06:51:18 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!