On Sat, 28 Jul 2012 20:32:57 +0200 "David Piepgrass" <qwertie...@gmail.com> wrote:
> What's the easiest way to time something in D? { import std.datetime; StopWatch stopWatch; stopWatch.start(); scope(exit) writeln(stopWatch.peek.msecs, "ms"); // Do stuff to be timed } Or use my verboseSection wrapper: https://bitbucket.org/Abscissa/semitwistdtools/src/8123e04b593c/src/semitwist/util/mixins.d#cl-644 bool verbose = true; ... { mixin(verboseSection!"Making the fizzbar"); makeFizzbar(); } Output: Making the fizzbar...732ms