-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Jacob Morris edited this page Jan 21, 2017
·
19 revisions
Welcome to the PyTimer wiki!
- Q: What is used internally for getting the time
- A:
time.perf_counter()
is used internally, as it should have the highest resolution. This accuracy, however, varies by operating system and hardware. Typically, it should be in the 1-10 ns range though.
- Q: Why can't I use a decorator with a recursive function
- A: So the decorator has a double-nested
for
loop, one loop foriterations
the other forreps
. Inside of both of these loops it calls the function, but then the function calls itself recursively, which starts the whole process over again. This process does end, but the total number of functions calls would bereps * iterations * # of recursive calls
which gets very large quickly.