sleep(1) - how long does it treally take?
Posted on 2001-07-19
Working on NT 4 (embedded version if it makes a difference), I know this is not a real time system, but I wonder how close I can get.
In the team we are debating whether sleep(1) really returns after 1 ms - some say it is more likely to return after 10 ms, and that it is not predictable at all.
To summarize: what is the best way to write a thread that is not in highest priority, and has to wait for exactly 1 ms (or as close as possible) in between doing some work.