Skip to content
Jacob Morris edited this page Jun 6, 2019 · 1 revision

Q: Can a recursive function be decorated with .decorate()?

Yes, but the recursive call must be altered. If foo is recursive, then the recursive call must be to foo.__wrapped__ to prevent the timing code from being executed recursively as well.

Q: How much overhead does ExecTiming add?

Very little. In fact, the measured times should be changed minimally by the timing code as operations that take longer, like those relating to call_callable_args, are excluded from the measured times. However, some operations like Timer.plot() and Timer.best_fit_curve() are going to be more intensive.

Q: How accurate is the timer used by ExecTiming?

perf_counter() is used internally and according to PEP 564, its resolution is system dependent. On Linux, it is accurate to about 82 ns and on Windows, it is accurate to about 100 ns.

Q: Does ExecTiming only measure the execution time of the code being timer?

No. As mentioned above, perf_counter() is used internally and it measures time system-wide. This should result in more real-world measurements.

Clone this wiki locally