]> git.ipfire.org Git - thirdparty/systemd.git/commit
util: make time formatting a bit smarter
authorLennart Poettering <lennart@poettering.net>
Thu, 4 Apr 2013 00:56:56 +0000 (02:56 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 4 Apr 2013 00:56:56 +0000 (02:56 +0200)
commit2fa4092c2829dd14e50c430ae2f23551d23c6c1d
treeacc0b56b0f7f1f93afde6a0feb8f38c332236352
parent911963f1a29897eee2fffbe503ac05ec13028a30
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.
18 files changed:
src/analyze/systemd-analyze.c
src/cgtop/cgtop.c
src/core/main.c
src/core/manager.c
src/core/mount-setup.c
src/core/selinux-setup.c
src/core/timer.c
src/core/unit.c
src/journal/journalctl.c
src/journal/test-journal-verify.c
src/shared/dbus-common.c
src/shared/label.c
src/shared/time-util.c
src/shared/time-util.h
src/shared/watchdog.c
src/systemctl/systemctl.c
src/test/test-efivars.c
src/test/test-time.c