diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-10-13 14:26:40 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-10-16 19:23:40 +0200 |
commit | a63cfc8b7c172aa7e849521a479d39af737681a8 (patch) | |
tree | ccc59220f05cfa581ee09018a90ab72c6ef4aa28 /Process.c | |
parent | 783be7711db0081a77fbcf84fbb63ab2a31ccc05 (diff) |
Refactor generating starttime string into Process class
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |