How do I get my Python program to sleep for 50 mil

2019-01-16 02:39发布

问题:

How do I get my Python program to sleep for 50 milliseconds?

回答1:

from time import sleep
sleep(0.05)

Reference



回答2:

Note that if you rely on sleep taking exactly 50 ms, you won't get that. It will just be about it.



回答3:

import time
time.sleep (50.0 / 1000.0);