A class representing a system timer.
Overrides from class PObject
Access functions
Operations
Comparison functions
Run Time Type functions
I/O functions
Miscellaneous functions
A class representing a system timer. The time interval ancestor value is the amount of time left in the timer.A timer on completion calls the virtual function OnTimeout(). This will in turn call the callback function provided by the instance. The user may either override the virtual function or set a callback as desired.
Note that only one timeout function can be executed at a time. The timeout function is also executed in the context of the PProcess instances thread of execution.
A list of active timers is maintained by the applications PProcess instance. This is used for sstealing the processor time to decrement the timers and call the timeout functions. A consequence of this is that no static timer instances can be running when the program terminates.
PTimer& operator=( DWORD milliseconds )
virtual ~PTimer()
void Stop()
BOOL IsRunning() const
void Pause()
void Resume()
BOOL IsPaused() const
The default behaviour of this function is to call the PNotifier callback function.
const PNotifier& GetNotifier() const
void SetNotifier( const PNotifier & func )
Note that even though this function returns milliseconds, the value may jump in minimum quanta according the platforms timer system, eg under MS-DOS and MS-Windows the values jump by 55 every 55 milliseconds. The Resolution() function may be used to determine what the minimum time interval is.
static unsigned Resolution()
Alphabetic index HTML hierarchy of classes or Java