How to use time object for code execution time in Python.
import time
#get starting time
start = time.time()
#codes which you want to measure execution time
for i in range(1, 100000):
print("")
#get ending time
end = time.time()
print("Total execution time of codes is ", end - start)
Be First to Comment