00001
00002 #include <iostream>
00003 #include <simgear/timing/timestamp.hxx>
00004
00005 using namespace std;
00006
00007 int main()
00008 {
00009 cout << "About to benchmark SGTimeStamp for 5 seconds. Press ENTER when ready." << endl;
00010 int c = cin.get();
00011 long nb = 0;
00012 SGTimeStamp start, now;
00013 start.stamp();
00014 do {
00015 nb += 1;
00016 now.stamp();
00017 } while ( ( now - start ).toMicroSeconds() < 5000000 );
00018
00019 cout << ( nb / 5 ) << " iterations per seconds. Press ENTER to quit." << endl;
00020 c = cin.get();
00021 }