import time start = time.process_time() # your code here     print(time.process_time() - start)

Read more of this post