Interval timer, used to time operations. More...
#include <mi32/mtimer.h>
Public Member Functions | |
| MTIMER () | |
| ~MTIMER () | |
| void | Clear () |
| void | GetString (MISTRING &string) const |
| double | GetValue () const |
| bool | IsOn () const |
| void | Report (MISTRING &string, TEXTID textid=TEXTID__None) const |
| void | ReportElapsed (MISTRING &string) const |
| void | ReportElapsedAbbr (MISTRING &string) const |
| void | ReportShort (MISTRING &string, int places=0) const |
| void | Set (double seconds) |
| void | Start () |
| void | Stop () |
Interval timer, used to time operations.
Timer is accurate to 100ns on Windows and 1ms on other platforms.
| MTIMER::MTIMER | ( | ) |
Default constructor.
| MTIMER::~MTIMER | ( | ) |
Destructor.
| void MTIMER::Clear | ( | ) |
Clear timer.
Also stops timer.
| void MTIMER::GetString | ( | MISTRING & | string | ) | const |
| double MTIMER::GetValue | ( | ) | const |
Get the value of the timer in seconds.
| bool MTIMER::IsOn | ( | ) | const |
Determine if timer is currently 'on'.
Report "Time to ???: xxx xxx xxx".
The ??? part is retrieved from the text resource file using the TEXTID provided. The rest of the message is built from text resource strings and the actual time.
If TEXTID__None is specified then only the time is reported.
| void MTIMER::ReportElapsed | ( | MISTRING & | string | ) | const |
Report elapsed time in simple format.
0-90 seconds reported as seconds. 1.5 to 90 minutes reported as minutes. > 90 minutes reported as hours.
| void MTIMER::ReportElapsedAbbr | ( | MISTRING & | string | ) | const |
Report elapsed time in simple format with abbreviated unit.
0-90 seconds reported as seconds. 1.5 to 90 minutes reported as minutes. > 90 minutes reported as hours.
| void MTIMER::ReportShort | ( | MISTRING & | string, | |
| int | places = 0 | |||
| ) | const |
Report in "00:00" format.
| places | number of decimal places in seconds (eg, 0:00.00) |
| void MTIMER::Set | ( | double | seconds | ) |
Set the value of the timer.
| void MTIMER::Start | ( | ) |
Start timer.
| void MTIMER::Stop | ( | ) |
Stop timer.
Does not clear the timer.
1.6.1