title: How long should a thread sleep when the event pattern doesn't apply?
body: <p>In the main loop of a worker thread that <em>has to</em> poll to know if there's work to do, I let it sleep in order to not busy-wait. How do I determine a good length for sleeping? E. g. if I wake up every millisecond, it's probably useless to sleep at all. If I wake up every ten minutes, it might make the app look unresponsive (depending on what the thread is doing).</p>
  
  <p>I've heard before what cadrian says below, that a human user won't notice timespans around 100 ms, but what about approaching it from the machine side? How small can the interval get before it starts to get wasteful?</p>
  
  <p>I guess, it boils down to a more general (i. e. platform-independent) version of <a href="https://stackoverflow.com/questions/508208/what-is-the-impact-of-thread-sleep1-in-c">this question</a>.</p>
  
  <p>EDIT: Of course, the question should always be rephrased first as "How can I change this to the event pattern instead of polling", but let's assume for now that I can't or don't want to.</p>