https://issues.dlang.org/show_bug.cgi?id=13724

--- Comment #3 from Steven Schveighoffer <[email protected]> ---
You're looking at it from the perspective that the time is the main thing you
care about, i.e. you don't care about the return value, just the time it took.
I look at it from the perspective that you want to time something that you are
already using.

For example, if you have something like:

37.fibonacci.foo();

Now, you want to keep your code the same, but get the time it took to do
fibonacci, how do you do that with the tuple return?

With a ref parameter, you can do:

ulong timer;
37.fibonacci.timeIt(timer).foo();

Now I have the timer, and I don't have to mess with my call chain (much).

It also allows easier cumulative timing.

--

Reply via email to