import time start_time = time.time() time.sleep(1) # to see how it work end_time = time.time() print (round(end_time - start_time)) #OUT PUT : 1