Clock

This class captures the concept of a simple timer. The granularity of the timer is in milliseconds. The granularity is specified when a Clock object is constructed and can be changed by the SetInterval method. The OnTimerEvent function is called at the end of each time interval with the name of the Clock object being passed as a parameter.

[ Index | Source | Summary | Member Functions ]

Quick Index


Class Summary

class Clock
{

public:
Clock (char* name, int interval );
void SetInterval(int newInterval);
void Start();
void Stop();
int IsNamed(char* name);
~Clock();
}; // Clock

Back to the top of Clock


Clock (char* name, int interval );

Construct a Clock with a given name and a give time interval. The Clock can be started and stopped (it is initially stopped).

  Clock (char* name, int interval=1000);

Back to the top of Clock


void SetInterval(int newInterval);

Change the interval of time used for the Clock.

  void SetInterval(int newInterval);

Back to the top of Clock


void Start();

Start the Clock running.

  void Start();

Back to the top of Clock


void Stop();

Stop the Clock.

  void Stop();

Back to the top of Clock


int IsNamed(char* name);

Is this the name of the Clock?