test/time_measure_test.cc
changeset 902 d2bc45e8f6f2
parent 463 88ed40ad0d4f
child 1157 761fe0846f49
equal deleted inserted replaced
3:6d23160a4e7e 4:1662e726e767
    37 
    37 
    38 int main()
    38 int main()
    39 {
    39 {
    40   Timer T;
    40   Timer T;
    41   unsigned int n;
    41   unsigned int n;
    42   for(n=0;T.realTime()<1.0;n++) ;
    42   for(n=0;T.realTime()<0.1;n++) ;
    43   std::cout << T << " (" << n << " time queries)\n";
    43   std::cout << T << " (" << n << " time queries)\n";
    44   T.restart();
    44 
    45   while(T.realTime()<2.0) ;
       
    46   std::cout << T << '\n';
       
    47   TimeStamp full;
    45   TimeStamp full;
    48   TimeStamp t;
    46   TimeStamp t;
    49   t=runningTimeTest(f,1,&n,&full);
    47   t=runningTimeTest(f,0.1,&n,&full);
    50   std::cout << t << " (" << n << " tests)\n";
    48   std::cout << t << " (" << n << " tests)\n";
    51   std::cout << "Total: " << full << "\n";
    49   std::cout << "Total: " << full << "\n";
    52 
    50 
    53   t=runningTimeTest(g,1,&n,&full);
    51   t=runningTimeTest(g,0.1,&n,&full);
    54   std::cout << t << " (" << n << " tests)\n";
    52   std::cout << t << " (" << n << " tests)\n";
    55   std::cout << "Total: " << full << "\n";
    53   std::cout << "Total: " << full << "\n";
    56 
    54 
    57   return 0;
    55   return 0;
    58 }
    56 }