diff options
Diffstat (limited to 'panel.py')
-rwxr-xr-x | panel.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -146,7 +146,8 @@ class ModDate(Mod): self.refreshing = False self.repaint(flush=True) - self.e.wait(1 - (dt.microsecond / 1000000)) + if (t := 1 - (dt.microsecond / 1000000)) > 0: + self.e.wait(t) self.e.clear() def process_cmd(self, cmd): @@ -418,7 +419,8 @@ class IntervalTimer(): if now > self.func_next_time.get(func, 0): func() self.func_next_time[func] = now - (now % ival) + ival - time.sleep(min(self.func_next_time.values()) - time.time()) + if (t := min(self.func_next_time.values()) - time.time()) > 0: + time.sleep(t) class ModInterval(Mod): timer = IntervalTimer() |