diff options
author | David Zarzycki <dave@znu.io> | 2021-04-10 08:02:59 -0400 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-04-10 14:43:23 +0200 |
commit | f3d9ecaa626f2f9124f5c53b083511572ef47a66 (patch) | |
tree | afc0cdea50dc4b98ef000708bb23a3bad8a8b8ab /Process.c | |
parent | 0006cc51b7c59775cadd4ff96a214730e79d9cc8 (diff) |
Convert process time to days if applicable
With big multicore machines, it's easy to accumulate process time.
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -150,11 +150,15 @@ void Process_printTime(RichString* str, unsigned long long totalHundredths) { unsigned long long totalSeconds = totalHundredths / 100; unsigned long long hours = totalSeconds / 3600; + unsigned long long days = totalSeconds / 86400; int minutes = (totalSeconds / 60) % 60; int seconds = totalSeconds % 60; int hundredths = totalHundredths - (totalSeconds * 100); char buffer[10]; - if (hours >= 100) { + if (days >= 100) { + xSnprintf(buffer, sizeof(buffer), "%7llud ", days); + RichString_appendAscii(str, CRT_colors[LARGE_NUMBER], buffer); + } else if (hours >= 100) { xSnprintf(buffer, sizeof(buffer), "%7lluh ", hours); RichString_appendAscii(str, CRT_colors[LARGE_NUMBER], buffer); } else { |