yogeshjoshi / laravel-time-logger
Laravel Time Logger is a lightweight and developer-friendly profiling utility for Laravel. It helps measure and log code execution time effortlessly, making performance debugging simple and efficient.
1.0.0
2025-04-09 08:27 UTC
Requires
- php: >=8.0
- laravel/framework: ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
Requires (Dev)
- phpunit/phpunit: >=9.0
README
A lightweight Laravel package that helps profile code execution time using RAII-style scoped timing.
Installation
composer require yogeshjoshi/laravel-time-logger
Usage
using class use LaravelTimeLogger\LaravelTimeLogger; function exportCSV() { $timer = new LaravelTimeLogger("Export CSV"); $timer->start(); // do work here $timer->stop(); } using helper function $timer = timerlog('Helper test'); $timer->start(); // do work here $timer->stop();
Publishing Config
php artisan vendor:publish --tag=laravel-time-logger
Config Options
log_channel
— Where to log results (default:daily
)enabled
— Enable or disable timing
You're ready to go!