[Issue 13724] std.datetime.timeIt

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Nov 13 06:03:10 PST 2014


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

--- Comment #2 from bearophile_hugs at eml.cc ---
(In reply to Steven Schveighoffer from comment #1)
> Don't we have a std.benchmark that does something like this?

Yes, but timeIt needs to be simpler. So it's a different purpose.

> BTW, I would recommend instead of returning the time in a tuple, put it in a
> ref parameter. This way, you can simply wrap any calls that you normally use.

I don't understand. Generally I don't like ref arguments, they don't allow me
simple usages as:

37.fibonacci.timeIt.writeln;
37.fibonacci.timeIt[1].writeln;

Usually ref parameters require more code, and more cognitive burden. Tuples are
usually winners over most alternatives.

--


More information about the Digitalmars-d-bugs mailing list