calculate running time in python code example
Example 1: find time of run for python code
import time
start_time = time.time()
main()
print("--- %s seconds ---" % (time.time() - start_time))
Example 2: use datetime python to get runtime
from datetime import datetime
start = datetime.now()
# code ...
print(datetime.now()-start)