[comp.windows.ms.programmer] timer

hruska@ecs.umass.edu (06/07/91)

I am trying to write a Windows program that uses a millisecond delay.
In DOS, and using the Borland C compiler, there is a convenient 
delay() function that allows delays in millisecond resolution. But
in Windows, the only timing function I've found is the SetTimer()
function. This can cause a WM_TIMER message to be put in the eventqueue
OR you can provide a call-back function that Windows calls when the
time limit expires. The manuals all say that the timers have millisecond
resolution but Petzold's book (and others) say that the timing REALLY
comes from the crumby system clock with resolutions of ~50 millisec.
And to top it all off, since Windows is a multitasking system, it may 
be that your program is not even running when the timed event occurs.
My question: Is there a way to get true millisecond timing resolution
(a simple delay is sufficient) and to hav this event not only notify
your program but to cause your program to become the currently running
program? 

please EMAIL me at hruska@ecs.umass.edu

Mark Hruska
hruska@ecs.umass.edu



Thanks in advance :)