yepstat is acting like status line that overwrites your very first terminal line every 0.5 seconds, so you can easily keep track of things that you ar

GitHub - su8/yepstat: yepstat is acting like status line that overwrites your very first terminal line every 0.5 seconds, so you can easily keep track of things that you are interested to monitor while hacking something in the terminal

submited by
Style Pass
2022-05-16 12:30:06

yepstat is acting like status line that overwrites your very first terminal line every 0.5 seconds, so you can easily keep track of things that you are interested to monitor while hacking something in the terminal. It's meant to be efficient and fast even when under 100% cpu and drive I/O load.

This is exactly what we do: save the current position of the cursor, move it to the top left corner of the terminal, clear the entire line, output the desired data and restore the cursor position, so you get the feeling that there is a real status line up there.

Do some simple benchmark to grasp over why tput doesn't provide us enough speed. Use the first tput example and decrease the sleep time to 0.1. Then try typing some text over and over as fast as you can and notice how many characters will NOT be written. Open up this program source code and replace "500L *" with "100L *", recompile and repeat the typing test. Move to the second tput example and again decrease the sleep down 0.1, and repeat the typing test.

Once you understand the concept, you'll find 6 interesting, after which you'll get why the program needs to be as fast as possible.

Leave a Comment