What unit of time does timeit return? What unit of time does timeit return? python python

What unit of time does timeit return?


The return value is seconds as a float.

It is the total time taken to run the test (not counting the setup), so the average time per test is that number divided by the number argument, which defaults to 1 million.

See the Time.timeit() documentation:

Time number executions of the main statement. This executes the setup statement once, and then returns the time it takes to execute the main statement a number of times, measured in seconds as a float. The argument is the number of times through the loop, defaulting to one million.