quick-n-dirty benchmark

This commit is contained in:
edmccard 2012-03-30 16:43:31 -04:00
parent 8a3292e33d
commit 712b7547c6
2 changed files with 20 additions and 0 deletions

2
test/benchcmd Normal file
View File

@ -0,0 +1,2 @@
-version=Benchmark -inline -release -O -I.. -I../src -g

View File

@ -246,3 +246,21 @@ unittest
writeln("Testing decimal mode, CMOS(Strict.yes, Cumulative.yes)");
testDecimalMode!(CPU!("65C02", true, true))();
}
version(Benchmark)
{
import std.datetime, std.stdio;
void f0()
{
testDecimalMode!(CPU!("65C02", false, false))();
}
void main()
{
// auto milliExpected = (61886766.0 / 1020484.0) * 1000;
auto milliExpected = (64508206.0 / 1020484.0) * 1000;
auto r = benchmark!(f0)(1);
writeln(milliExpected / r[0].to!("msecs", int));
}
}