From 1da942802023e541cae0850258969d17118b36c4 Mon Sep 17 00:00:00 2001 From: Cyan Joeng Date: Sun, 13 Nov 2022 03:53:54 +0000 Subject: [PATCH] Add a reading timeout to refreshing loop of view to decrease the cpu cost --- termpdf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/termpdf.py b/termpdf.py index 96ee9e0..f70e424 100755 --- a/termpdf.py +++ b/termpdf.py @@ -1521,6 +1521,8 @@ def view(file_change,doc): count = int(count_string) scr.stdscr.nodelay(True) + scr.stdscr.timeout(100) + key = scr.stdscr.getch() while key == -1 and not file_change.is_set(): key = scr.stdscr.getch()