Python Time Delays

Have a look at threading.Timer. It runs your function in a new thread.

from threading import Timer

def hello():
    print "hello, world"

t = Timer(30.0, hello)
t.start() # after 30 seconds, "hello, world" will be printed

Leave a Comment