ATEasy Timers

Knowledge Base Article # Q200008

Read Prior Article Read Next Article
Summary Describes the two types of timers that ATEasy provides

ATEasy has two types of timers:

1.   ATimer control

2.   INT_TIMERx interrupts

The ATimer is based on the windows WM_TIMER message (not an accurate timer). Windows documentation describes the WM_TIMER message as a low-priority message. The GetMessage and PeekMessage functions post this message only when no other higher-priority messages are in the thread's message queue.

The INT_TIMERx interrupts are based on the Window MultiMedia Timers (see the Windows SDK for timeSetEvent API). The multimedia timers provide accuracy up to 1 ms. ATEasy's ability to deliver 1 ms interrupts depends on the time required to execute a single PCode command. Since interrupts cannot be called in the middle of a PCode command in that thread, this time may be long if the thread calling a DLL function takes a long time before it completes.

The following list alternatives to the above mentioned timers:
  • Create an ATEasy thread and use the Sleep() function to form a delay between events. Call SetThreadPriority() to ensure more accurate timer.
  • Write a DLL and use the multimedia timer timeSetEvent. This method is accurate, but requires a callback function that must be implemented in a DLL. This method could be more accurate if implemented in its own thread.
  • Write a DLL and use the Windows SetWaitableTimer. This method is accurate (better than 1 ms), but requires a callback function must be implemented in a DLL in its own thread.
  • Use hardware to implement the handler functionality.
Article Date 7/28/2000
Keywords ATEasy, ATimer, INT_TIMERx

0 ratings | 0 out of 5
Read Prior Article Read Next Article