From f03194f84eafa01f46c192646e7b8c007eb11647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Thu, 17 Mar 2016 21:41:44 +0100 Subject: [PATCH] tests/xtimer_drift: Add explanation for drift and jitter --- tests/xtimer_drift/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/xtimer_drift/main.c b/tests/xtimer_drift/main.c index 6e4aaf2830..a3f9584bd3 100644 --- a/tests/xtimer_drift/main.c +++ b/tests/xtimer_drift/main.c @@ -115,7 +115,7 @@ void *worker_thread(void *arg) int32_t drift = now - expected; expected = last + TEST_HZ * TEST_INTERVAL; int32_t jitter = now - expected; - printf("now=%" PRIu32 ".%06" PRIu32 " (%u hours %u min), drift=%" PRId32 ", jitter=%" PRId32 "\n", + printf("now=%" PRIu32 ".%06" PRIu32 " (%u hours %u min), drift=%" PRId32 " us, jitter=%" PRId32 " us\n", sec, us, hr, min, drift, jitter); last = now; } @@ -136,6 +136,9 @@ int main(void) (unsigned long)TEST_INTERVAL, (unsigned long)TEST_HZ); puts("The current time will be printed once per second, along with the " "difference between the actual and expected xtimer_now value."); + puts("The first output variable, 'drift', represents the total offset since " + "start between xtimer_now and the expected time."); + puts("The second output variable, 'jitter', represents the difference in drift from the last printout."); puts("Two other threads are also running only to cause extra interrupts and context switches."); puts(" <====== PC clock if running in pyterm."); puts("");