-
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 ]
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).
- name : the character string that will be passed as the
name of the Clock when the OnTimerEvent function is called.
- interval : the interval of time, measured in milliseconds
between calls to the OnTimerEvent function when the Clock is
running.
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.
- newInterval : the new Clock interval (measured in
milliseconds.
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?
- name : the character string that is compared to the
name given when the Clock object was constructed. A one (1) is
returned if the strings match and a zero (0) is returned
otherwise.
int IsNamed(char* name);
Back to the top of Clock
~Clock();
Destruct the Clock object.
~Clock();
Back to the top of Clock
Member Functions
- public:
- void SetInterval(int newInterval);
- void Start();
- void Stop();
- int IsNamed(char* name);
Back to the top of Clock
Generated from source by the Cocoon utilities on Thu Apr 02 12:40:04 1998
.
Report problems to jkotula@unimax.com