Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
Closed
Description
Documentation
At the moment, it is as follows.
Lines 164 to 169 incb4615f
| deftimeit(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 differenttimer 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 thetimer argument of the constructor (by default: a float measured in seconds).' Or similar?