diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2017-01-02 12:51:04 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2017-01-05 10:35:05 +0100 |
commit | fad3a14b7fd8cc490a1625e0dbdf606e4c896476 (patch) | |
tree | 522774267294db2e8a7f6182328c66b4f27c1fbe | |
parent | 39b95ab409445ee761811e909a1742ad4985ff87 (diff) |
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 <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | flowtop.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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(); |