diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-04 02:56:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-04 02:56:56 +0200 |
commit | 2fa4092c2829dd14e50c430ae2f23551d23c6c1d (patch) | |
tree | acc0b56b0f7f1f93afde6a0feb8f38c332236352 /src/shared/time-util.h | |
parent | 911963f1a29897eee2fffbe503ac05ec13028a30 (diff) |
util: make time formatting a bit smarter
Instead of outputting "5h 55s 50ms 3us" we'll now output "5h
55.050003s". Also, while outputting the accuracy is configurable.
Basically we now try use "dot notation" for all time values > 1min. For
>= 1s we use 's' as unit, otherwise for >= 1ms we use 'ms' as unit, and
finally 'us'.
This should give reasonably values in most cases.
Diffstat (limited to 'src/shared/time-util.h')
-rw-r--r-- | src/shared/time-util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/time-util.h b/src/shared/time-util.h index a02cdfc79f..3fc339507c 100644 --- a/src/shared/time-util.h +++ b/src/shared/time-util.h @@ -74,7 +74,7 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u); char *format_timestamp(char *buf, size_t l, usec_t t); char *format_timestamp_relative(char *buf, size_t l, usec_t t); -char *format_timespan(char *buf, size_t l, usec_t t); +char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy); void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t); void dual_timestamp_deserialize(const char *value, dual_timestamp *t); |