title: sleep of non-blocking calls
body: <p>I am looking for an optimum sleep value to receive data from a non-blocking socket. E.g: </p>
  
  <pre><code>while True:
      data=s.recv(1024)
      if not data:
          time.sleep(10) #10ms
      else:
          pass #...
  </code></pre>
  
  <p>No sleep would lead into 100% CPU usage, so any idea how to get the best CPU Usage and bandwith? How long has a sleep to be so the CPU can do a thread switch?</p>
  
  <p>Btw, does it make sense to set the buffer of the socket via SO_SNDBUF/SO_RECVBUF and set TCP_NODELAY or shouldn't they be combined?</p>