Skip to content

Commit f327fc6

Browse files
committed
wip
1 parent e361bc8 commit f327fc6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

helpers.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4366,6 +4366,10 @@ To invoke a callback more than once, you may specify the number of iterations th
43664366

43674367
Benchmark::dd(fn () => User::count(), iterations: 10); // 0.5 ms
43684368

4369+
Sometimes, you may want to benchmark the execution of a callback while still obtaining the value returned by the callback. The `value` method will return a tuple containing the value returned by the callback and the amount of milliseconds it took to execute the callback:
4370+
4371+
[$count, $duration] = Benchmark::value(fn () => User::count());
4372+
43694373
<a name="dates"></a>
43704374
### Dates
43714375

0 commit comments

Comments
 (0)