From a340e5336d28f5f945287a87d9d20775516c4557 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 4 Aug 2021 01:39:00 +0200 Subject: util: Fix millisecond logging timestamp calculation Four sub-second digits means 0.1ms units: divide nanoseconds by 10^5, not 10^6. Signed-off-by: Stefano Brivio --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index fe18cd8..46589a4 100644 --- a/util.c +++ b/util.c @@ -48,7 +48,7 @@ void name(const char *format, ...) { \ tm = gmtime(&tp.tv_sec); \ strftime(ts, sizeof(ts), "%b %d %T.", tm); \ \ - fprintf(stderr, "%s%04lu: ", ts, tp.tv_nsec / (1000 * 1000)); \ + fprintf(stderr, "%s%04lu: ", ts, tp.tv_nsec / (100 * 1000)); \ va_start(args, format); \ vsyslog(level, format, args); \ va_end(args); \ -- cgit v1.2.3