summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2011-12-14 23:29:07 +0000
committerHisham Muhammad <hisham@gobolinux.org>2011-12-14 23:29:07 +0000
commit9c44f589d2aab70309d11bc5a0050c145452fb4f (patch)
treeaef0a3de1debc6236acac6eed815926a421088b0 /Process.c
parent0bb8dba9371d6caa6fefc7ab0034b11fd109ab36 (diff)
show proper values for very large times
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/Process.c b/Process.c
index fec3f330..cadf7dd5 100644
--- a/Process.c
+++ b/Process.c
@@ -312,19 +312,24 @@ static void Process_printTime(RichString* str, unsigned long long t) {
double realTime = t * jiffytime;
int iRealTime = (int) realTime;
- int hours = iRealTime / 3600;
+ unsigned long long hours = iRealTime / 3600;
int minutes = (iRealTime / 60) % 60;
int seconds = iRealTime % 60;
int hundredths = (realTime - iRealTime) * 100;
char buffer[11];
- if (hours) {
- snprintf(buffer, 10, "%2dh", hours);
+ if (hours >= 100) {
+ snprintf(buffer, 10, "%7lluh ", hours);
RichString_append(str, CRT_colors[LARGE_NUMBER], buffer);
- snprintf(buffer, 10, "%02d:%02d ", minutes, seconds);
} else {
- snprintf(buffer, 10, "%2d:%02d.%02d ", minutes, seconds, hundredths);
+ if (hours) {
+ snprintf(buffer, 10, "%2lluh", hours);
+ RichString_append(str, CRT_colors[LARGE_NUMBER], buffer);
+ snprintf(buffer, 10, "%02d:%02d ", minutes, seconds);
+ } else {
+ snprintf(buffer, 10, "%2d:%02d.%02d ", minutes, seconds, hundredths);
+ }
+ RichString_append(str, CRT_colors[DEFAULT_COLOR], buffer);
}
- RichString_append(str, CRT_colors[DEFAULT_COLOR], buffer);
}
static inline void Process_writeCommand(Process* this, int attr, int baseattr, RichString* str) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy