python timer import code example
Example 1: python timer()
def hello():
print "hello, world"
t = Timer(30.0, hello)
t.start() # after 30 seconds, "hello, world" will be printed
Example 2: python timer
import time
start = time.time()
# do something
duration = time.time() - start