summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpanel.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/panel.py b/panel.py
index 59d4874..77a6a51 100755
--- a/panel.py
+++ b/panel.py
@@ -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()