In python, if I want to keep a process or thread running forever, I can typically do this with an empty while loop:
while 1:
pass
This, however, will eat an unfair amount of CPU process. Adding a short sleep would work:
import time
while 1:
time.sleep(0.01)
Is there any best or cleaner way of doing this?