Laravel, Testing, How To, PHP, Web Development.
amount of milliseconds it took to execute the callback: [$count, $duration] = Benchmark::value(fn () => User::count()); Note: Let us look at two queries to see how Benchmarking can help us. Benchmark::dd([ 'Count 1' => fn () => User::count(), // 0.5 ms 'Count 2' => fn () => User::all()->count(), //