From 8198e0c827df826b13610b1342e22517409a9807 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Wed, 25 Sep 2024 19:53:35 -0400 Subject: [PATCH] =?UTF-8?q?connection:=20print=20debug=20time=20mod=201000?= =?UTF-8?q?0=20seconds,=20not=20mod=202^32=20=C2=B5s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it easier to compare WAYLAND_DEBUG output with timestamps from other sources. Signed-off-by: Manuel Stoeckl --- src/connection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connection.c b/src/connection.c index 2d1e8d1d..dcb56650 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1547,7 +1547,7 @@ wl_closure_print(struct wl_closure *closure, struct wl_object *target, struct argument_details arg; const char *signature = closure->message->signature; struct timespec tp; - unsigned int time; + uint64_t time; uint32_t nval; FILE *f; char *buffer; @@ -1558,10 +1558,10 @@ wl_closure_print(struct wl_closure *closure, struct wl_object *target, return; clock_gettime(CLOCK_REALTIME, &tp); - time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000); + time = ((tp.tv_sec % 10000LL) * 1000000LL) + (tp.tv_nsec / 1000); fprintf(f, "%s[%7u.%03u] ", color ? WL_DEBUG_COLOR_GREEN : "", - time / 1000, time % 1000); + (unsigned int)(time / 1000), (unsigned int)(time % 1000)); #if defined(HAVE_GETTID) if (include_tid < 0) {