codetiming
codetiming copied to clipboard
Can this library be used in production code, does it save all the timing values.
I am wondering if the Time class stores all the timing values it receives. I was intrigued since median computation would require something like that. If it does store it, does that mean the data structure grows unbounded?
TLDR; unless you explicitly call timer.timers.clear() it will grow unbounded.
https://github.com/realpython/codetiming/blob/main/codetiming/_timers.py#L24-L33
The Timers class is a class attribute of the Timer. It keeps a record of all starts and stops. So you need to clear it yourself every now and them.