# HG changeset patch # User alpar # Date 1139217113 0 # Node ID a60b681d0825c7635281bee1745acceebb40ae7a # Parent 264811b995f3057abb6987df655fa36d9cfaf4d3 - Increased max. number of iteration - Better tests. diff -r 264811b995f3 -r a60b681d0825 lemon/time_measure.h --- a/lemon/time_measure.h Mon Feb 06 09:10:43 2006 +0000 +++ b/lemon/time_measure.h Mon Feb 06 09:11:53 2006 +0000 @@ -515,7 +515,7 @@ Timer t; TimeStamp full; int total=0; - for(int tn=1;tn < 1<<24; tn*=2) { + for(int tn=1;tn < 1<<30; tn*=2) { for(;totalmin_time) { diff -r 264811b995f3 -r a60b681d0825 test/time_measure_test.cc --- a/test/time_measure_test.cc Mon Feb 06 09:10:43 2006 +0000 +++ b/test/time_measure_test.cc Mon Feb 06 09:11:53 2006 +0000 @@ -28,10 +28,19 @@ void f() { double d=0; - for(int i=0;i<10000;i++) + for(int i=0;i<1000;i++) d+=0.1; } +void g() +{ + static Timer T; + + double d=0; + for(int i=0;i<1000;i++) + TimeStamp x(T); +} + int main() { Timer T; @@ -42,7 +51,12 @@ while(T.realTime()<2.0) ; std::cout << T << '\n'; TimeStamp full; - TimeStamp t=runningTimeTest(f,1,&n,&full); + TimeStamp t; + t=runningTimeTest(f,1,&n,&full); + std::cout << t << " (" << n << " tests)\n"; + std::cout << "Total: " << full << "\n"; + + t=runningTimeTest(g,1,&n,&full); std::cout << t << " (" << n << " tests)\n"; std::cout << "Total: " << full << "\n";