diff --git a/scripts/plot.py b/scripts/plot.py index 0bae380b..32fc62fa 100755 --- a/scripts/plot.py +++ b/scripts/plot.py @@ -1445,11 +1445,10 @@ def main(csv_paths, *, ptime = time.time() inotify.read() inotify.close() - # sleep for a minimum amount of time, this helps reduce - # flicker issues + # sleep a minimum amount of time to avoid flickering time.sleep(max(0, (sleep or 0.01) - (time.time()-ptime))) else: - time.sleep(sleep or 0.1) + time.sleep(sleep or 2) except KeyboardInterrupt: pass @@ -1669,7 +1668,7 @@ if __name__ == "__main__": '-s', '--sleep', type=float, help="Time in seconds to sleep between redraws when running " - "with -k. Defaults to 0.01.") + "with -k. Defaults to 2 seconds.") def dictify(ns): if hasattr(ns, 'subplots'): diff --git a/scripts/tailpipe.py b/scripts/tailpipe.py index e2a85379..ee3a1efa 100755 --- a/scripts/tailpipe.py +++ b/scripts/tailpipe.py @@ -129,6 +129,7 @@ def main(path='-', *, event.clear() with lock: ring.draw() + # sleep a minimum amount of time to avoid flickering time.sleep(sleep or 0.01) th.Thread(target=background, daemon=True).start() @@ -143,7 +144,7 @@ def main(path='-', *, if not keep_open: break # don't just flood open calls - time.sleep(sleep or 0.1) + time.sleep(sleep or 2) except FileNotFoundError as e: print("error: file not found %r" % path, file=sys.stderr) @@ -182,7 +183,7 @@ if __name__ == "__main__": parser.add_argument( '-s', '--sleep', type=float, - help="Seconds to sleep between reads. Defaults to 0.01.") + help="Seconds to sleep between reads.") parser.add_argument( '-k', '--keep-open', action='store_true', diff --git a/scripts/tracebd.py b/scripts/tracebd.py index 21a5ab27..039d7b2b 100755 --- a/scripts/tracebd.py +++ b/scripts/tracebd.py @@ -1020,6 +1020,7 @@ def main(path='-', *, draw(ring) if not cat: ring.draw() + # sleep a minimum amount of time to avoid flickering time.sleep(sleep or 0.01) th.Thread(target=background, daemon=True).start() @@ -1044,7 +1045,7 @@ def main(path='-', *, if not keep_open: break # don't just flood open calls - time.sleep(sleep or 0.1) + time.sleep(sleep or 2) except FileNotFoundError as e: print("error: file not found %r" % path, file=sys.stderr) diff --git a/scripts/watch.py b/scripts/watch.py index 90a77cc7..4d84591a 100755 --- a/scripts/watch.py +++ b/scripts/watch.py @@ -247,12 +247,11 @@ def main(command, *, ptime = time.time() inotify.read() inotify.close() - # sleep for a minimum amount of time, this helps reduce - # flicker issues + # sleep a minimum amount of time to avoid flickering time.sleep(max(0, (sleep or 0.01) - (time.time()-ptime))) # or sleep else: - time.sleep(sleep or 0.1) + time.sleep(sleep or 2) except KeyboardInterrupt: pass @@ -291,7 +290,7 @@ if __name__ == "__main__": parser.add_argument( '-s', '--sleep', type=float, - help="Seconds to sleep between runs. Defaults to 0.1.") + help="Seconds to sleep between runs. Defaults to 2 seconds.") parser.add_argument( '-k', '--keep-open', action='store_true',