Jump to content
  • Advertisement
Sign in to follow this  

Hardware timer issues

This topic is 3914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I know there are a lot of posts about hardware timers but I have not found one that answers my issue. If there is one already present please point me to it and ill read it. The problem I am having is the hardware timer isn’t giving me the values I expect. This is currently the code I am using: void timer::Start(void) { QueryPerformanceCounter(&htStart); } void timer::Stop(void) { QueryPerformanceCounter(&mTimeStop); } double timer::Hardware(void) { QueryPerformanceFrequency(&perf_frequ); hdt = (double)(htStart.QuadPart-mTimeStop.QuadPart)/(double) perf_frequ.QuadPart; return hdt; } I call Start, then Hardware do my process then stop and loop again. I also have a gettime running along side this and the hardware timer values are alot different than the normal time on. e.g. Software = 2.685 Hardware = 0.000474796 Im not quite sure what im doing wrong with the hardware time. Hope you can help Adam

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!