[phobos] Proposal of StopWatch module

Andrei Alexandrescu andrei at erdani.com
Tue Aug 17 12:18:34 PDT 2010


Would be great to integrate StopWatch with the hastily written 
std.date.benchmark.

Andrei

On 08/17/2010 01:19 PM, 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.
>
> On Tue, Aug 17, 2010 at 6:43 AM, SHOO <zan77137 at nifty.com
> <mailto:zan77137 at nifty.com>> wrote:
>
>     I made the module of the stopwatch, so I suggest it again here.
>
>     I suggested a time handling module that I called std.time before.
>     Unfortunately itself was not able to contribute to Phobos for the issue
>     of license. But, an important function was included in it. It is what is
>     the StopWatch suggested this time.
>
>     I have some knowledge about machine control engineering. In the field of
>     the machine control engineering, the high accuracy time measurement
>     often plays an important role.
>     For example, the case wants to perform the measurement of the voltage
>     with time by millisecond order for feedback control. When it looks like
>     it, resolution power is not enough by time acquisition such as C's time
>     function in many cases.
>
>     Or the high accuracy time measurement is important in the game
>     programming, too. Or in benchmark testing, too.
>
>     There is std.perf in Phobos as a module with this role now.
>     However, the module is unlisted, and a license doesn't seem to be a
>     Boost license, too.
>     I did not refer Tango at all about this class and examined and made it
>     in my own hand completely.
>
>     Here is the module to suggest this time:
>     http://ideone.com/TVw1P
>
>     # This module is tested by Windows (real) and Ubuntu (virtual PC).
>
>     Please look at it once by all means, and review it.
>     I think that I will commit it at 2010-08-22T15:00Z as far as there is
>     not serious dissenting opinion.
>     _______________________________________________
>     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