COIN-OR::LEMON - Graph Library

Changeset 1689:f1795dafe42c in lemon-0.x for test


Ignore:
Timestamp:
09/28/05 10:14:39 (14 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2213
Message:
  • runningTimeTest(): a tool to measure running times more precisely.
  • TimeStamp? now uses double to count cpu-times
  • 'get's removed from the query functions of Times and TimeStamp?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/time_measure_test.cc

    r1435 r1689  
    2424using namespace lemon;
    2525
     26void f()
     27{
     28  double d=0;
     29  for(int i=0;i<10000;i++)
     30    d+=0.1;
     31}
     32
    2633int main()
    2734{
    2835  Timer T;
    29   while(T.getRealTime()<1.0) ;
     36  int n;
     37  for(n=0;T.realTime()<1.0;n++) ;
     38  std::cout << T << " (" << n << " time queries)\n";
     39  T.reset();
     40  while(T.realTime()<2.0) ;
    3041  std::cout << T << '\n';
    31   T.reset();
    32   while(T.getRealTime()<2.0) ;
    33   std::cout << T << '\n';
     42  TimeStamp full;
     43  TimeStamp t=runningTimeTest(f,1,&n,&full);
     44  std::cout << t << " (" << n << " tests)\n";
     45  std::cout << "Total: " << full << "\n";
    3446 
    3547  return 0;
Note: See TracChangeset for help on using the changeset viewer.