Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Need help with timers

Need help with timers

Need help with timers

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."

RE: Need help with timers

That's about the best resolution you'll get on the standard system timers. Try doing a search for 'high resolution timers' on MSDN.

RE: Need help with timers

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close