From fad3a14b7fd8cc490a1625e0dbdf606e4c896476 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Mon, 2 Jan 2017 12:51:04 +0200 Subject: flowtop: Minimize delay via halfdelay(1) function Use halfdelay(1) to poll keyboard input with delay in 1 tenth of second and get rid of custom usleep(...) using. With this approach (it is also used in htop tool) the key events are more sensitive to user inputs. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- flowtop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flowtop.c b/flowtop.c index f382d6c..f48f5c8 100644 --- a/flowtop.c +++ b/flowtop.c @@ -1238,6 +1238,7 @@ static void presenter(void) screen = screen_init(false); wclear(screen); + halfdelay(1); start_color(); INIT_COLOR(RED, BLACK); @@ -1320,8 +1321,6 @@ static void presenter(void) draw_flows(screen, &flow_list, skip_lines); draw_footer(); - - usleep(80000); } rcu_unregister_thread(); -- cgit v1.2.3-54-g00ecf