summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-08-01 00:38:32 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2022-08-01 01:17:13 -0700
commite3b6242938fa9bcc3aebaa0eddd6aa561136dbf1 (patch)
tree6b134a3a3135215f48bc15e69670ab6b67471132
parent9d4633e934da77bc1c3617a9450ee17151f35271 (diff)
downloademacs-e3b6242938fa9bcc3aebaa0eddd6aa561136dbf1.tar.gz
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.
-rw-r--r--src/sysdep.c5
1 files 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 ();