How to measure time elapsed in Python


import time

start_time = time.time()
# your code
elapsed_time = time.time() - start_time