Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used windows time(VC++)r to call my function at interval of 11 millisecond but when I print time in my callback function I found out that it is not getting called at interval of 11 ms but it is getting called at 15-16 milliseconds. If I give interval as 17 it is getting called at interval 31 to 32 milliseconds.
I dont know why this is happening??

then I have called similar function in C# on same machine, it also shows same interval. I am using Intel Core to Duo machine with 2 GB RAM.
When I read timer MSDN I found out that it gives acceracy upto 10 milli second.
Can Anybody suggest me proper solution to my problem so that it can get accuracy upto 10 millisecond.
Thank you in advance for your help.
Posted

1 solution

Windows timers generally run off the hardware timer, which has a resolution of 10 - 15ms (depending on the hardware, most run at 15.6ms intervals) so when you ask for a lower interval, you get an accuracy of 10ms in teh timer value, but a resolution of 15ms in the timer interval.

There is an article here which may help, but you have some work to do! http://msdn.microsoft.com/en-us/magazine/cc163996.aspx[^]
 
Share this answer
 
Comments
Rahul Rajat Singh 21-May-12 6:10am    
Very very valuable information. my +5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900