How to use time.sleep() within a function correctly?
time.sleep() - odd timing results
Correct usage of perf_counter:
from time import perf_counter, sleepMore on reddit.com
s=perf_counter()
sleep(3)
e=perf_counter()
print(e-s)
[Question] A more accurate time.sleep() ?
time.sleep() not working?
Videos
Long story short i am making a rpg games (text based) in python and need a little help. I am using the time library to give a delay between certain ASCII banners popping up in the console. However, i dont want to have to write out 'time.sleep()' or copy and paste it every time i want to use it. Therefore, i made a function which I would use to shorten the time it would take me to right out 'time.sleep()':
def wait(time):
time.sleep(time)
wait(1)
Whilst in theory i thought this would work (im new to python, i have much to learn yet), it gives me this error:
time.sleep(time)
AttributeError: 'int' object has no attribute 'sleep'
I was wondering if anyone could help/point me in the right direction on how to go about this problem. Thanks in advance!