Se que es de hace un mes pero te dejo un ej con time
     
Código Python:
Ver originalimport time
 
def microtime():
    return int(round(time.time() * 1000))
 
ti = microtime()
while True:
    tf = microtime()
    if abs(tf-ti) >= 3000:
        #pass 3 segs without stop the program
        #break #i guess?