I need to make my python program wait for 200ms before polling for an input of some description. In C# for example, I could use Thread.Sleep()
to achieve this. What is the simplest means of doing this in python?
Use Time module.
For example, to delay 1 second :
import time
time.sleep(1) # delay for 1 seconds
In your case, if you want to get 200 ms, use this instead:
time.sleep(0.2)
time.sleep also works with float.
If you simply want to sleep you can try:
import time
time.sleep(0.2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With