Next: , Up: Part III Other Objects   [Contents][Index]


21.1 Timer Object

Timer objects can be used to make a timer that runs down toward 0 or runs up toward a pre-set value after which it starts blinking and returns itself to the application program. This can be used in many different ways, for example, to give a user a certain amount of time for completing a task, etc. Also hidden timer objects can be created. In this case the application program can take action at the moment the timer expires. For example, you can use this to show a message that remains visible until the user presses the "OK" button or until a certain amount of time has passed.

The precision of the timer is not very high. Don’t count on anything better than, say, 50 milli-seconds, especially when the system is rather busy. The timer can trigger early by up to 10 ms. Run the demo timerprec.c for an actual accuracy measurement.