Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
What does it guarantee?
Does it guarantee to block at least defined time?
Or it can unblock earlier than defined time?

In my app Timers.Timer.Interval = 1 takes much more longer than Thread.Sleep(1).
Why?
Posted
Updated 9-May-15 22:42pm
v6

1 solution

The problem is in the discrimination of the timer: which is dependent on your hardware and the OS. Have a look at the "Remarks" section of MSDN: Sleep function[^]

Low intervals (like 1ms) will always be less accurate than higher values.
 
Share this answer
 

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