From c4834ffaefa8cd4ec18be97395d8a3e8ad1748e6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 22 Jun 2017 21:10:34 +0200 Subject: [PATCH] tests: show current monotonic/boottime/realtime clock values in test-time When debugging time issues its kinda handy to have an easy way to query the three clocks, hence let's just output them at the beginning of test-time. --- src/test/test-time.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test-time.c b/src/test/test-time.c index d9a6d61..601e835 100644 --- a/src/test/test-time.c +++ b/src/test/test-time.c @@ -372,6 +372,13 @@ static void test_usec_shift_clock(void) { int main(int argc, char *argv[]) { uintmax_t x; + log_info("realtime=" USEC_FMT "\n" + "monotonic=" USEC_FMT "\n" + "boottime=" USEC_FMT "\n", + now(CLOCK_REALTIME), + now(CLOCK_MONOTONIC), + now(clock_boottime_or_monotonic())); + test_parse_sec(); test_parse_time(); test_parse_nsec(); -- 2.7.4