From 3392cebd9e863d3e5af43940e3424d2ced396486 Mon Sep 17 00:00:00 2001 From: JilayPandya Date: Thu, 6 Jul 2023 09:50:19 +0200 Subject: [PATCH] samples: zbus: add leading zeros while printing duration 1.This change will print leading zeros after delimeter in the event of duration being less than 0.1ns 2.This change was tested on mimxrt1060_evk with :samples/subsys/zbus/benchmark sample Signed-off-by: Jilay Pandya --- samples/subsys/zbus/benchmark/src/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/subsys/zbus/benchmark/src/benchmark.c b/samples/subsys/zbus/benchmark/src/benchmark.c index fbdc0d9d1defd4b..ac781a6306f96e3 100644 --- a/samples/subsys/zbus/benchmark/src/benchmark.c +++ b/samples/subsys/zbus/benchmark/src/benchmark.c @@ -200,7 +200,7 @@ static void producer_thread(void) LOG_INF("Bytes sent = %lld, received = %lu", BYTES_TO_BE_SENT, atomic_get(&count)); LOG_INF("Average data rate: %llu.%lluMB/s", i, f); - LOG_INF("Duration: %llu.%llus", duration / NSEC_PER_SEC, duration % NSEC_PER_SEC); + LOG_INF("Duration: %lld.%09llus", duration / NSEC_PER_SEC, duration % NSEC_PER_SEC); printk("\n@%llu\n", duration); }