tsc_ITimerMonitor

This class allows timer events to be sent to event handlers in any class.

tsc_ITimerMonitor is available in SDK version 1.90 and higher.

Also see the general information page about event handling.

To use this class, subclass tsc_ITimerMonitor and override the event handling methods to handle the resulting timer expiry events.  A timer monitor implements one periodic timer and one single-shot timer. The two timers are independent, and may be used individually or concurrently.  Only one tsc_ITimerMonitor class may be implemented in a given subclass.

Public methods

void StartSingleTimer (double seconds);
Start or replace the one-shot timer. The subclass's OnSingleTimer event will be raised after the supplied time.  The timer event handler will be called on the thread that calls StartSingleTimer.

void StartPeriodicTimer (double seconds);
Start or replace the periodic timer. The subclass's OnPeriodicTimer event will be raised every time the period expires.  The timer event handler will be called on the thread that calls StartPeriodicTimer.

void StopSingleTimer ();
Stops the single-shot timer.

void StopPeriodicTimer ();
Stops the periodic timer.

virtual void OnSingleTimer ();
Receives the event raised by the single-shot timer expiring.

virtual void OnPeriodicTimer ();
Receives the event raised each time the periodic timer expires.