Mercurial > projects > dynamin
diff dynamin/core/benchmark.d @ 106:acdbb30fee7e
Port to D2.
Most of the effort was dealing with immutable and const.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Mon, 17 Dec 2012 23:41:50 -0600 |
parents | 5c8c1c2e12c0 |
children |
line wrap: on
line diff
--- a/dynamin/core/benchmark.d Sat Nov 24 10:21:50 2012 -0600 +++ b/dynamin/core/benchmark.d Mon Dec 17 23:41:50 2012 -0600 @@ -30,17 +30,17 @@ /** * name can be null */ -double benchmarkAndWrite(string name, int repetitions, void delegate() dg) { +double benchmarkAndWrite(cstring name, int repetitions, void delegate() dg) { double time = benchmark(repetitions, dg); Stdout.format("{} took {:.2}ms.", name, time).newline; // TODO: verify :.2 return time; } -double benchmarkAndWrite(string name, void delegate() dg) { +double benchmarkAndWrite(cstring name, void delegate() dg) { return benchmarkAndWrite(name, 1, dg); } /** - * As the constructor calls the Start() method, the only time one would need + * As the constructor calls the start() method, the only time one would need * to is when reusing a Benchmark object. */ class Benchmark { @@ -54,7 +54,7 @@ long time() { return _startTime-Environment.runningTime; } - void writeTime(string opName) { + void writeTime(cstring opName) { if(opName is null) opName = "Benchmark"; Stdout.format("{} took {}ms.", opName, time).newline;