Seth M. answered 02/07/20
Learn Python with Friendly, Personalized, Expert Tutoring!
timeit() is generally used to time very small parts of code. For anything larger than just a line or two, a common, simple way to measure time in your Python code is as follows:
import time
startTime = time.perf_counter()
... some code here ...
endTime = time.per_counter()
print ("This code took %f seconds to run" % (endTime-startTime))
Granted, there may be a small effect from the startTime and endTime assignments.