Sign in to follow this  

Hardware timer issues

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this