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.
PHP 8.3+ · Laravel 12.x / 13.x
composer require sandermuller/stopwatch
php artisan vendor:publish --tag=stopwatch-config # optionalstopwatch()->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: 15mscheckpoint() 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:
@stopwatchPublished 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
- Slow-run notifications · AI assistant integration · Standalone PHP
- Configuration · API
The sources are in docs/.
composer testCHANGELOG lists the recent changes.
CONTRIBUTING covers local setup and the pull-request process.
Report a vulnerability through the security policy rather than a public issue.
The MIT License (MIT). Please see the License File for more information.
