Using Timer Queues

The following example creates a timer routine that will be executed by a thread from a timer queue after a 10 second delay. First, the code uses the
CreateEvent function to create an event object that is signaled when the timer-queue thread completes. Then it creates a timer queue and a timer-queue timer, using the
CreateTimerQueue and
CreateTimerQueueTimer functions, respectively. The code uses the
WaitForSingleObject function to determine when the timer routine has completed. Finally, the code calls
DeleteTimerQueue to clean up.