import time stopwatch = time.time() #your code here *example* time.sleep(1) End = time.time() - stopwatch print(End)