]> git.ipfire.org Git - thirdparty/systemd.git/commit
analyze: Add "timespan" command to dump time span in usec
authorChris Down <chris@chrisdown.name>
Mon, 15 Oct 2018 11:55:35 +0000 (12:55 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 Oct 2018 12:26:51 +0000 (14:26 +0200)
commit3f1c1287a96dfc146ce894bd6bfff388cba0ab55
tree15282aa532acccdb64d3165238311a7144879578
parentf402ce827daf8556dc5ec058889c031a9dfd55a5
analyze: Add "timespan" command to dump time span in usec

This is useful for a couple of cases, I'm mostly interested in case #1:

1. Verifying "reasonable" values in a trivially scriptable way
2. Debugging unexpected time span parsing directly

Test Plan:

```
% build/systemd-analyze timespan 20
Original: 20
      μs: 20
   Human: 20us
% build/systemd-analyze timespan 20ms
Original: 20ms
      μs: 20000
   Human: 20ms
% build/systemd-analyze timespan 20z
Failed to parse time span '20z': Invalid argument
```
man/systemd-analyze.xml
man/systemd.time.xml
src/analyze/analyze.c
src/basic/locale-util.c
src/basic/locale-util.h
src/test/test-locale-util.c