First off I want to state that I have only been doing Win32 programming for about a month now so go easy on me
Lately I have written a few screensaver-esque programs, like bouncing lines and such. In order to get the speed correct in between drawing new lines, I have done two different things. First off I used the Sleep() function and had it sleep for about a millisecond or so before continuing on. This worked great except that I soon found out that the amount of time waiting seems to be dependant on processor speed. At home sleeping for 5 milliseconds zips along on my 1.8 GHz while at work it moves pretty slowly when sleeping at only 1 millisecond on a 900 MHz. If I take away the sleep function it moves at unrecognizable speeds so I know that my work comp can compute everything quick enough. It looks great at home but looks terrible at work since it moves too slowly.
So then I learned about the SetTimer() function and WM_TIMER. Now the speed is the same on every computer BUT moves kinda slow on ALL comps even if I set the timer to only 1 millisecond. It won't let me input fractions of a millisecond and I even tested it on zero milliseconds - still ran as though it were at 1 millisecond.
Is there anyway to set a timer to run less than one millisecond or another method I could try that would run the same speed on all comps?