add more struct timespec/Time formatters
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 5 Feb 2018 13:49:28 +0000 (14:49 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 27 Mar 2019 09:31:38 +0000 (10:31 +0100)
commit9f39641d5b3f1666900eb7b7be88236711078ff6
tree9ad8f65e25e899c0539608031a485770173e3bb3
parentcf960f736f6733f3cab2d518df82915b50a8fab2
add more struct timespec/Time formatters

Add formatters for durations:

* format_sec_msec: ``1s 337ms'', and
* format_min_sec_msec: ``1m3.370s'' (following time(1)).

Also only use string option types when there is actually an error
path under our control (e. g. with snprintf(3)). (NB the
omnipresent to_string() does not propagate formatting errors
upward so the wrappers we have for it return a plain string.)
src/timefunc.cpp
src/timefunc.hxx
test/test_timefunc.cpp