Print LOG time as uptime
This commit is contained in:
@@ -533,10 +533,7 @@ static inline int log_header(log_component_t *c,
|
|||||||
if ( flag & FLAG_TIME ) {
|
if ( flag & FLAG_TIME ) {
|
||||||
struct timespec t;
|
struct timespec t;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||||
static double tOrigin=0;
|
snprintf(timeString, sizeof t,"%05.3f",t.tv_sec+t.tv_nsec/1.0e9);
|
||||||
if (tOrigin==0)
|
|
||||||
tOrigin=t.tv_sec+t.tv_nsec/1.0e9;
|
|
||||||
snprintf(timeString, sizeof t,"%05.3f",t.tv_sec+t.tv_nsec/1.0e9-tOrigin);
|
|
||||||
} else {
|
} else {
|
||||||
timeString[0]=0;
|
timeString[0]=0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user