[phobos] Proposal of StopWatch module

SHOO zan77137 at nifty.com
Tue Aug 17 12:37:52 PDT 2010


(2010/08/18 3:19), David Simcha wrote:
> Looks good.  One small convenience feature I'd like, though, is the
> ability to do simple microbenchmarks with less boilerplate, something like:
>
> import std.stopwatch, std.stdio;
>
> void main() {
>      writeln(timeMillisecond({
>          // Do stuff.
>      });
> }
>
> timeMilliseconds would simply take a void delegate(), time its execution
> and return the time it takes in milliseconds.  Similar things could be
> done for timeMicroseconds and timeSeconds.
>

I think that it is not the function of the stopwatch.
How about making std.benchmark? :)
There seems to be room for some arguments about the interface.


More information about the phobos mailing list