Today, it's possible to reset the accumulated timers by clearing the timers dictionary:
However, this may lead to errors if a timer has already been initialized (typically because it's used as a decorator and initialized at import-time). Therefore a better way is to explicitly set existing timers to 0:
Timer.timers.update({k: 0 for k in Timer.timers})
However, this becomes hard to read, and even harder to write.
A better solution would be to have explicit support for resetting the accumulated timers.
Today, it's possible to reset the accumulated timers by clearing the
timersdictionary:However, this may lead to errors if a timer has already been initialized (typically because it's used as a decorator and initialized at import-time). Therefore a better way is to explicitly set existing timers to 0:
However, this becomes hard to read, and even harder to write.
A better solution would be to have explicit support for resetting the accumulated timers.