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!

QueryPerformanceCounter

Status
Not open for further replies.

sonnur

Programmer
Oct 25, 2002
2
TR
I can't use QueryPerformanceCounter API because installed hardware doesn't support the high resolution counter as I read from its Help section.How can I prevent this problem?What do I have to install to my machine to make work this API?
 
Erm...if the hardware doesn't support it, then you are stuffed. On the other hand, are you sure that it is a hardware problem?
 
Hi strongm,
I think I have made a mistake while I was using the QueryPerformanceCounter.For now it is ok and I can have the exact time that I expect.But I still don't know why there is a hardware problem when a user uses QueryPerformanceCounter.Which people can't use this API?Is it about OS?

Thanks
Sonnur
 
Sorry for the delay in replying, but I've been away.

No, it is not an OS issue, it is a hardware issue. If you issue a QueryPerformanceFrequency call before using QueryPerformanceCounter (and you should use it at least once), it may return 0, which indicates a failure. Whilst you could then use GetLastError for specific info, you will normally find that the failure is caused by the fact the hardware does not actually have a high-resolution performance counter available.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top