top: added some elapsed running time 'ELAPSED' support

When the 'STARTED' field was added, in the message for
the commit referenced below, I explained why 'ELAPSED'
shouldn't be implemented though it might be preferred.

Well, after climbing out of my box to do a little more
thinking, I came up with the way to add that 'ELAPSED'
field while avoiding the possible performance penalty.

Just do not show what would change with every refresh!

If we do not show the seconds portion of a scaled tics
amount then the problem goes away. And this comes with
an additional benefit. The HH,MM (hours,minutes) style
then is readily compared with that system uptime shown
as HH:MM. The only difference is just the comma/colon.

[ assuming the top uptime/load average toggle was on ]

Reference(s):
. introduced 'start time' field
commit 7647e96b0a

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2022-02-27 00:00:00 -06:00
committed by Craig Small
parent a749414f16
commit 9348d3b008
4 changed files with 29 additions and 7 deletions

View File

@@ -356,6 +356,9 @@ static void build_two_nlstabs (void) {
/* Translation Hint: maximum '%CUU' = 6 */
Head_nlstab[EU_CUU] = _("%CUU");
Desc_nlstab[EU_CUU] = _("CPU Utilization");
/* Translation Hint: maximum 'ELAPSED' = 7 */
Head_nlstab[EU_TM4] = _("ELAPSED");
Desc_nlstab[EU_TM4] = _("Elapsed Running Time");
}