From e3b6242938fa9bcc3aebaa0eddd6aa561136dbf1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 1 Aug 2022 00:38:32 -0700 Subject: [PATCH] Fix get-internal-runtime precision MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/sysdep.c (make_lisp_s_us): Also define if HAVE_GETRUSAGE. (Fget_internal_run_time): Don’t generate more precision than the underlying primitives. --- src/sysdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sysdep.c b/src/sysdep.c index c1545622dfc..efd9638b07a 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -3169,7 +3169,8 @@ list_system_processes (void) #endif /* !defined (WINDOWSNT) */ -#if defined __FreeBSD__ || defined DARWIN_OS || defined __OpenBSD__ +#if (HAVE_GETRUSAGE \ + || defined __FreeBSD__ || defined DARWIN_OS || defined __OpenBSD__) static Lisp_Object make_lisp_s_us (time_t s, long us) @@ -4276,7 +4277,7 @@ does the same thing as `current-time'. */) usecs -= 1000000; secs++; } - return make_lisp_time (make_timespec (secs, usecs * 1000)); + return make_lisp_s_us (secs, usecs); #else /* ! HAVE_GETRUSAGE */ #ifdef WINDOWSNT return w32_get_internal_run_time (); -- 2.39.2