CreateWaitableTimer for this. You can wait for it
on a dedicated worker thread using
shared worker using
WaitForMultipleObjects, or even on your UI
thread by writing your main message loop to use
Your 5ms precision should be achievable unless your system is badly
overloaded. Thread priorities can help, but I/O is rarely prioritized, so
if you do a blocking read of a file, you can be queued behind read requests
from the same disk from much lower priority threads. Try to load any data
in advance or use overlapped requests and deal with the condition that the
request hasn't completed yet when your timer interval expires.
And I definitely would suggest using
make all system timers more precise.