Documentation
At the moment, it is as follows.
|
def timeit(self, number=default_number): |
|
"""Time 'number' executions of the main statement. |
|
|
|
To be precise, this executes the setup statement once, and |
|
then returns the time it takes to execute the main statement |
|
a number of times, as a float measured in seconds. The |
The return value may not always be a float measured in seconds. If a different timer function is used:
timeit.timeit(timer=time.perf_counter_ns)
then it is an integer measured in nanoseconds.
Not entirely sure how to document it unambiguously, but perhaps it can be reworded to say something like: '… as a number measured in the time unit returned by the timer argument of the constructor (by default: a float measured in seconds).' Or similar?
Linked PRs