I would like to print an output like the following in a fixed position while the numbers in the block keep updating every couple of seconds. It is similar to what top
does.
Jobs monitor:
+-----------------------------------------+
| Waiting | Launched | Running | Finished |
+-----------------------------------------+
| 319 | 364 | 94 | 201 |
+-----------------------------------------+
Elapsed time: 21s
Is there a way to do that?
With only one line, I could do it with STDOUT.flush
and "\r"
, but it does not work for multiple lines since the carriage will put the cursor at the beginning of the new line only.