Laravel, Testing, How To, PHP, Web Development.
Illuminate\Support\Benchmark; Benchmark::measure(fn() => Post::find(1)); // Returns time in ms. // i.e., 0.1ms // Run each callback five times Benchmark::measure([ fn() => Post::find(1), fn() => Post::find(5), ], 5); // [0.03, 0.04] // You can also use keys Benchmark::measure([ 'Post 1' => fn() =>