import time
# Start the timer
start_time = time.time()
# Your code block
# Example:
for i in range(1000000):
pass
# End the timer
end_time = time.time()
# Calculate and print the elapsed time
execution_time = end_time - start_time
print(f"Execution time: {execution_time} seconds")Execution time: 0.021715879440307617 seconds