python espera 1 segundo
import time
# Wait for 5 seconds
time.sleep(5)
# Wait for 300 milliseconds
# .3 can also be used
time.sleep(.300)
Blushing Bat
import time
# Wait for 5 seconds
time.sleep(5)
# Wait for 300 milliseconds
# .3 can also be used
time.sleep(.300)
import time
while True:
print("This prints once a minute.")
time.sleep(60) # Delay for 1 minute (60 seconds).
import time
#Waits 1 second
time.sleep(1)
import time
def waitUntil(condition, output): #defines function
wU = True
while wU == True:
if condition: #checks the condition
output
wU = False
time.sleep(60) #waits 60s for preformance
waitUntil(Cookies >= 0, eatCookies()) #runs function (output MUST be another function)
# You need to import time first
import time
#now you have time you can make time wait/sleep
time.sleep(10)
#time will wait/sleep for 10 seconds
import time
def wait_until(somepredicate, timeout, period=0.25, *args, **kwargs):
mustend = time.time() + timeout
while time.time() < mustend:
if somepredicate(*args, **kwargs): return True
time.sleep(period)
return False