Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with timers

Status
Not open for further replies.

AmkG

Programmer
May 12, 2001
366
PH
I need to update my window some 25 times a second, or preferably 30. Now, I tried using SetTimer but if I give any value less than 55 milliseconds, it's updated as fast as if it were set at 55 milliseconds. This means I can only update 18.2 times per second. Anyone know how I can update faster? I don't want to have to use some other language's library just to do this, I'll need to do this just with the SDK routines.

Possibly use threads? One thread to check the system's internal timer and another that gets called? Do threads need to yield time to the system like the old-style Window processes? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
That's about the best resolution you'll get on the standard system timers. Try doing a search for 'high resolution timers' on MSDN.
 
You have two options: MultimediaTimer, or a WaitableTimer
The first is a timer that can be set to call a callback
when it expires, the second is a synchronization object
you can wait on (probably in a separate thread).
Both can be used only in WinNt 4.0 and on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top