Skip to content
Jacob Morris edited this page Jan 21, 2017 · 19 revisions

Welcome to the PyTimer wiki!

FAQ

  • 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 for iterations the other for reps. 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 be reps * iterations * # of recursive calls which gets very large quickly.
Clone this wiki locally