import time start_time = time.time() # some code stop_time = time.time() print(stop_time-start_time)