From: Paul Eggert Date: Mon, 1 Aug 2022 07:38:32 +0000 (-0700) Subject: Fix get-internal-runtime precision X-Git-Tag: emacs-29.0.90~1447^2~585 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e3b6242938fa9bcc3aebaa0eddd6aa561136dbf1;p=emacs.git Fix get-internal-runtime precision * 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. --- 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 ();