mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Refactor generating starttime string into Process class
This commit is contained in:

committed by
cgzones

parent
783be7711d
commit
a63cfc8b7c
@ -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;
|
||||
|
Reference in New Issue
Block a user