# Timer Controls and Multithreading

You can create or discard a timer control only in the thread in which you load or create the panel that contains it.

ResumeTimerCallbacks and SuspendTimerCallbacks affect only timer controls loaded or created in the active thread.

When you call ResetTimer with the first parameter set to -1, it resets all timer controls loaded or created in the active thread.

LabWindows/CVI invokes timer callbacks only in the thread in which you created the timer control. Consequently, making a program multithreaded can reduce the accuracy of the intervals between one timer callback invocation and another.

For the most accurate timer possible, use the AsyncTmr instrument driver. The AsyncTmr instrument driver uses the Windows multimedia timer. On each occurrence of a timer event, it creates a high-priority thread and invokes a callback. Use the following path to locate the AsyncTmr instrument driver:

<cvi>\toolslib\toolbox\asynctmr.*