Skip to content

Commit c4e3f04

Browse files
authored
Merge pull request #5465 from Plywood9/fix-timer-busy-loop
Fix busy loop on lagging timer
2 parents d373878 + f426c16 commit c4e3f04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/textual/timer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async def _run(self) -> None:
153153
next_timer = start + ((count + 1) * _interval)
154154
now = _time.get_time()
155155
if self._skip and next_timer < now:
156-
count += 1
156+
count = int((now - start) / _interval + 1)
157157
continue
158158
now = _time.get_time()
159159
wait_time = max(0, next_timer - now)

0 commit comments

Comments
 (0)