In Laravel 9.32 we have a Benchmark class that can measure the time of any task.
It's a pretty useful helper:
class OrderController{ public function index() { return Benchmark::measure(fn () => Order::all()), }}
Tip given by @mmartin_joo
Enjoyed This Tip?
Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.
Recent Courses
[NEW] Building a Typical Laravel SaaS
8 lessons
1 h 07 min
Laravel Modules and DDD
16 lessons
1 h 59 min
NativePHP: Build Mobile App with Laravel
11 lessons
2 h 2 min read