May-04-2020, 10:12 PM
There are a couple ways, both of which use the time library. First you'll need to import time. The first method is
time.sleep(seconds)
, which is very simple, but sometimes you may need to do something else to run code while waiting. Here's some example code of the other method.import time timeStamp = time.time() #Records a number measured in epoch time waitTime = 10 while time.time() - timeStamp < waitTime: #Run code hereHope this helps