如何让Python程序休眠50毫秒?

时间:2021-05-17 07:14:34

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

如何让Python程序休眠50毫秒?

3 个解决方案

#1


540  

from time import sleep
sleep(0.05)

Reference

参考

#2


58  

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

注意,如果你只需要睡眠50毫秒,你就不会得到这个结果。就这样了。

#3


45  

import time
time.sleep (50.0 / 1000.0);

#1


540  

from time import sleep
sleep(0.05)

Reference

参考

#2


58  

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

注意,如果你只需要睡眠50毫秒,你就不会得到这个结果。就这样了。

#3


45  

import time
time.sleep (50.0 / 1000.0);