What is the best way to make an event happen at a set rate? Using time.sleep() is very unreliabe. Can things be locked to a timer of sorts?
<p>I'd like a function to be performed at a set rate, say, 6 times a second. What it is the best way to go about this with Python? </p>

<p>I tried a simple time.sleep() thing at the end of my loop, but that, of course, acts nothing like a reliable clock. Any change in CPU usage, and suddenly the "timer" has drifted quite far from where it started. </p>
