Skip to content

Skip empty cancelled timers#958

Open
Zironic wants to merge 1 commit into
ostris:mainfrom
Zironic:fix/cancelled-timer-print
Open

Skip empty cancelled timers#958
Zironic wants to merge 1 commit into
ostris:mainfrom
Zironic:fix/cancelled-timer-print

Conversation

@Zironic

@Zironic Zironic commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

I found this error while doing various benchmark tests.

Timer.start() creates an empty deque, while Timer.cancel() removes only the active start time. Upstream Timer.print() later calculates:

sum(timings) / len(timings)

That divides by zero when the first timed execution was cancelled by an exception or handled OOM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant