1.1 --- a/lemon/time_measure.h Sat Oct 14 15:26:05 2006 +0000
1.2 +++ b/lemon/time_measure.h Tue Oct 17 10:31:20 2006 +0000
1.3 @@ -517,22 +517,19 @@
1.4 ///\return The average running time of \c f.
1.5
1.6 template<class F>
1.7 - TimeStamp runningTimeTest(F f,double min_time=10,int *num = NULL,
1.8 + TimeStamp runningTimeTest(F f,double min_time=10,unsigned int *num = NULL,
1.9 TimeStamp *full_time=NULL)
1.10 {
1.11 + TimeStamp full;
1.12 + unsigned int total=0;
1.13 Timer t;
1.14 - TimeStamp full;
1.15 - int total=0;
1.16 - for(int tn=1;tn < 1<<30; tn*=2) {
1.17 + for(unsigned int tn=1;tn <= 1<<31 && full.realTime()<=min_time; tn*=2) {
1.18 for(;total<tn;total++) f();
1.19 full=t;
1.20 - if(full.realTime()>min_time) {
1.21 - if(num) *num=total;
1.22 - if(full_time) *full_time=full;
1.23 - return full/total;
1.24 - }
1.25 }
1.26 - return TimeStamp();
1.27 + if(num) *num=total;
1.28 + if(full_time) *full_time=full;
1.29 + return full/total;
1.30 }
1.31
1.32 /// @}
2.1 --- a/test/time_measure_test.cc Sat Oct 14 15:26:05 2006 +0000
2.2 +++ b/test/time_measure_test.cc Tue Oct 17 10:31:20 2006 +0000
2.3 @@ -43,7 +43,7 @@
2.4 int main()
2.5 {
2.6 Timer T;
2.7 - int n;
2.8 + unsigned int n;
2.9 for(n=0;T.realTime()<1.0;n++) ;
2.10 std::cout << T << " (" << n << " time queries)\n";
2.11 T.restart();