|
STIRA
0.1
|
small timer class to get execution timings of applications Ref: http://osr600doc.sco.com/en/SDK_c++/_Measuring_Program_Execution_Tim.html For windows, this becomes http://www.dreamincode.net/forums/showtopic24685.htm with some code #include <windows.h> // code long int before = GetTickCount(); More...
#include <ExecutionTimer.h>
Public Member Functions | |
| ExecutionTimer () | |
| Constructor. | |
| ~ExecutionTimer () | |
| Destructor. | |
| double | GetCurrentTime () |
| Gets current calender time, converted internally from time_t object to double (in seconds) | |
| void | StartTimer () |
| starts the timer (and resets the previous elapsed time to 0) | |
| void | StopTimer () |
| stops the timer (and computes the latest elapsed time) | |
| float | GetElapsedUserTimeInSeconds () |
| gets user time (the CPU time spent executing the user's code) in seconds | |
| float | GetElapsedSystemTimeInSeconds () |
| gets system time (the CPU time spent by the operating system on behalf of the user's code) in seconds | |
| float | GetElapsedRealTimeInSeconds () |
| gets real time (elapsed, or ``wall clock'' time) in seconds | |
| void | PrintTimeAsUserAndSystemTimes () |
| print elapsed times (user, system and real) on command line | |
small timer class to get execution timings of applications Ref: http://osr600doc.sco.com/en/SDK_c++/_Measuring_Program_Execution_Tim.html For windows, this becomes http://www.dreamincode.net/forums/showtopic24685.htm with some code #include <windows.h> // code long int before = GetTickCount();
// Perform time-consuming operation long int after = GetTickCount(); cout << "Execution Time : " << ( after - before ) << " ms."
Alternative reference: http://en.allexperts.com/q/C-1040/time-milliseconds-Windows.htm
1.8.11