gtimer.h

This interface exports a general interval timer.
Type
GTimer This type implements a simple interval timer that generates a timer event with a specified frequency.
Functions
newGTimer(milliseconds) Creates a timer that generates a timer event each time the specified number of milliseconds has elapsed.
freeGTimer(timer) Frees the resources associated with the timer.
startTimer(timer) Starts the timer.
stopTimer(timer) Stops the timer so that it stops generating events.

Type detail


typedef struct GTimerCDT *GTimer;
This type implements a simple interval timer that generates a timer event with a specified frequency.

Function detail


GTimer newGTimer(double milliseconds);
Creates a timer that generates a timer event each time the specified number of milliseconds has elapsed. No events are generated until the client calls startTimer.

Usage:

timer = newGTimer(milliseconds);

void freeGTimer(GTimer timer);
Frees the resources associated with the timer.

Usage:

freeGTimer(timer);

void startTimer(GTimer timer);
Starts the timer. A timer continues to generate timer events until it is stopped; to achieve the effect of a one-shot timer, the simplest approach is to call the stop function inside the event handler.

Usage:

startTimer(timer);

void stopTimer(GTimer timer);
Stops the timer so that it stops generating events.

Usage:

stopTimer(timer);