Benchmarking a callback and get its return value in Laravel
August 26, 2023 — You know Laravel always had the Illuminate\Support\Benchmark
helper function which you can use to benchmark a callback and print it. For instance, if you want to benchmark a callback function, here’s how you can do it.