time how long my code took to run python 3' code example
Example 1: how to record execution time in python
import time
start = time.time()
print("hello")
end = time.time()
print(end - start)
Example 2: how to time a python script
from datetime import datetime
start = datetime.now()
# some kind of code
print(datetime.now() - start)