[phobos] Proposal of StopWatch module

Andrei Alexandrescu andrei at erdani.com
Tue Aug 17 13:06:09 PDT 2010


The google unittest library largely considers benchmarking as part of 
unittesting, so if we have some other ideas for unittest tools the 
benchmark could be bundled with them in e.g. std.unittesting.

Otherwise, I'd rather try to integrate new stuff within existing 
modules. That's why I put benchmark in std.date.


Andrei

On 08/17/2010 02:47 PM, David Simcha wrote:
> What else might std.benchmark contain?  I assume the main point of
> stopwatch will be benchmarking, and I really despise ridiculously fine
> grained imports like Tango, gtkD or the Tango standard library, where I
> have to import 30 different modules to accomplish anything useful.
>
> On Tue, Aug 17, 2010 at 3:37 PM, SHOO <zan77137 at nifty.com
> <mailto:zan77137 at nifty.com>> wrote:
>
>     (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.
>
>     _______________________________________________
>     phobos mailing list
>     phobos at puremagic.com <mailto:phobos at puremagic.com>
>     http://lists.puremagic.com/mailman/listinfo/phobos
>
>
>
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list