sandermuller/stopwatch
| Install | |
|---|---|
composer require sandermuller/stopwatch |
|
| Latest Version: | v0.14.0 |
| PHP: | ^8.3 |
| License: | MIT |
| Last Updated: | Sep 17, 2026 |
| Links: | GitHub · Packagist |
Stopwatch for PHP & Laravel
A lightweight profiler for PHP and Laravel. Add checkpoints, measure closures, track queries, memory and outbound HTTP, and see where the time goes. Use it when a request, command or job feels slow and an APM is more than you need. It runs in production, in tests and in CI.
It also works as a debugger you read afterwards: with STOPWATCH_DEBUG=true, stopwatch()->probe('label', [...]) calls are written to disk as they happen, and php artisan stopwatch:runs:show latest shows their values in execution order. An AI agent can run that loop on its own.
PHP 8.3+ · Laravel 12.x / 13.x
Installation
composer require sandermuller/stopwatch
php artisan vendor:publish --tag=stopwatch-config # optional
Quick start
stopwatch()->withQueryTracking()->start();
$users = User::all();
stopwatch()->checkpoint('Load users');
$orders = Order::where('status', 'pending')->get();
stopwatch()->checkpoint('Load orders');
stopwatch()->toLog('Profile:');
// Profile:
// [3ms / 3ms] Load users (queries=1)
// [12ms / 15ms] Load orders (queries=1)
// Total: 15ms
checkpoint() starts the stopwatch on its own, so start() is only needed to reset an earlier run.
Render it as a self-contained HTML card instead:
@stopwatch

Documentation
Published at https://sandermuller.github.io/Stopwatch/.
- Why Stopwatch?: what it answers, and when an APM is the better tool
- Installation · Getting started · Checkpoints · Query, memory and HTTP tracking
- HTML report · Profiler toolbar · Server-Timing and Debugbar
- Persistent run log · Crash diagnostics · Debugging with probes
- Slow-run notifications · AI assistant integration · Standalone PHP
- Configuration · API
The sources are in docs/.
Testing
composer test
Changelog
CHANGELOG lists the recent changes.
Contributing
CONTRIBUTING covers local setup and the pull-request process.
Security vulnerabilities
Report a vulnerability through the security policy rather than a public issue.
Credits
License
The MIT License (MIT). Please see the License File for more information.
Related Packages
A Guzzle middleware that logs requests to debugbar's timeline
Inspect, profile and visualize every stage of the Laravel request lifecycle — fr...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.14.0 | ^8.3 | ^12.0| | MIT | |
| v0.13.1 | ^8.3 | ^12.0| | MIT | |
| v0.13.0 | ^8.3 | ^12.0| | MIT | |
| v0.12.0 | ^8.3 | ^12.0| | MIT | |
| v0.11.0 | ^8.3 | ^12.0| | MIT | |
| v0.10.0 | ^8.3 | ^11.0| | MIT | |
| v0.9.1 | ^8.3 | ^11.0| | MIT | |
| v0.9.0 | ^8.3 | ^11.0| | MIT | |
| v0.8.0 | ^8.3 | ^11.0| | MIT | |
| v0.7.0 | ^8.3 | ^11.0| | MIT | |
| v0.6.1 | ^8.3 | ^11.0| | MIT | |
| v0.6.0 | ^8.3 | ^11.0| | MIT | |
| v0.5.2 | ^8.3 | ^11.0| | MIT | |
| 0.5.1 | ^8.3 | ^11.0| | MIT | |
| v0.5.0 | ^8.3 | ^11.0| | MIT | |
| v0.4.2 | ^8.3 | ^11.0| | MIT | |
| v0.4.1 | ^8.3 | ^11.0| | MIT | |
| v0.4.0 | ^8.3 | ^11.0| | MIT | |
| v0.3.5 | ^8.3 | ^11.0| | MIT | |
| v0.3.4 | ^8.3 | ^11.0| | MIT | |
| v0.3.3 | ^8.3 | ^11.0| | MIT | |
| v0.3.2 | ^8.3 | ^11.0| | MIT | |
| v0.3.1 | ^8.3 | ^11.0| | MIT | |
| v0.3.0 | ^8.3 | ^11.0| | MIT | |
| v0.2.0 | ^8.2 | ^11.0| | MIT | |
| v0.1.8 | ^8.2 | ^11.0 | MIT | |
| v0.1.7 | ^8.2 | ^10.0| | MIT | |
| v0.1.6 | ^8.2 | ^10.0| | MIT | |
| v0.1.5 | ^8.2 | ^10.0| | MIT | |
| v0.1.4 | ^8.2 | ^10.0| | MIT |
Showing the latest 30 of 38. See every release on Packagist
Pre-releases (1)
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.3.0-rc1 | ^8.3 | ^11.0| | MIT |