Files
simgear/simgear/timing/testtimestamp.cxx
frohlich f1f0fa0aa9 Make use of posix clocks if available.
Have a more general timestamp implementation.
Very useful for higher accuracy timings.

Modified Files:
	simgear/structure/subsystem_mgr.cxx
	simgear/structure/subsystem_mgr.hxx
	simgear/timing/testtimestamp.cxx simgear/timing/timestamp.cxx
	simgear/timing/timestamp.hxx
2009-03-18 07:53:49 +01:00

22 lines
489 B
C++
Executable File

#include <iostream>
#include <simgear/timing/timestamp.hxx>
using namespace std;
int main()
{
cout << "About to benchmark SGTimeStamp for 5 seconds. Press ENTER when ready." << endl;
int c = cin.get();
long nb = 0;
SGTimeStamp start, now;
start.stamp();
do {
nb += 1;
now.stamp();
} while ( ( now - start ).toMicroSeconds() < 5000000 );
cout << ( nb / 5 ) << " iterations per seconds. Press ENTER to quit." << endl;
c = cin.get();
}