summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-10-13 14:26:40 +0200
committercgzones <cgzones@googlemail.com>2020-10-16 19:23:40 +0200
commita63cfc8b7c172aa7e849521a479d39af737681a8 (patch)
treeccc59220f05cfa581ee09018a90ab72c6ef4aa28 /Process.c
parent783be7711db0081a77fbcf84fbb63ab2a31ccc05 (diff)
Refactor generating starttime string into Process class
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Process.c b/Process.c
index 2d5ffb4f..43a4c47e 100644
--- a/Process.c
+++ b/Process.c
@@ -181,6 +181,12 @@ void Process_printTime(RichString* str, unsigned long long totalHundredths) {
}
}
+void Process_fillStarttimeBuffer(Process* this) {
+ struct tm date;
+ (void) localtime_r(&this->starttime_ctime, &date);
+ strftime(this->starttime_show, sizeof(this->starttime_show) - 1, (this->starttime_ctime > (time(NULL) - 86400)) ? "%R " : "%b%d ", &date);
+}
+
static inline void Process_writeCommand(const Process* this, int attr, int baseattr, RichString* str) {
int start = RichString_size(str), finish = 0;
const char* comm = this->comm;

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