Question

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

Was it helpful?

Solution

from time import sleep
sleep(0.05)

Reference

OTHER TIPS

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

import time
time.sleep(50 / 1000)

can also using pyautogui as

import pyautogui
pyautogui._autoPause(0.05,1)

_autoPause(time1,time2): it Pauses the command for time1*time2 sec time1 refers to how many secs you want time2 refers to repeat how many time both can be floats for example pyautogui._autoPause(0.1,0.2) will Pause for 0.1*0.2 = 0.02 sec

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top