aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2022-08-01 00:38:32 -0700
committerPaul Eggert2022-08-01 01:17:13 -0700
commite3b6242938fa9bcc3aebaa0eddd6aa561136dbf1 (patch)
tree6b134a3a3135215f48bc15e69670ab6b67471132 /src
parent9d4633e934da77bc1c3617a9450ee17151f35271 (diff)
downloademacs-e3b6242938fa9bcc3aebaa0eddd6aa561136dbf1.tar.gz
emacs-e3b6242938fa9bcc3aebaa0eddd6aa561136dbf1.zip
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.
Diffstat (limited to 'src')
-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)
3169 3169
3170#endif /* !defined (WINDOWSNT) */ 3170#endif /* !defined (WINDOWSNT) */
3171 3171
3172#if defined __FreeBSD__ || defined DARWIN_OS || defined __OpenBSD__ 3172#if (HAVE_GETRUSAGE \
3173 || defined __FreeBSD__ || defined DARWIN_OS || defined __OpenBSD__)
3173 3174
3174static Lisp_Object 3175static Lisp_Object
3175make_lisp_s_us (time_t s, long us) 3176make_lisp_s_us (time_t s, long us)
@@ -4276,7 +4277,7 @@ does the same thing as `current-time'. */)
4276 usecs -= 1000000; 4277 usecs -= 1000000;
4277 secs++; 4278 secs++;
4278 } 4279 }
4279 return make_lisp_time (make_timespec (secs, usecs * 1000)); 4280 return make_lisp_s_us (secs, usecs);
4280#else /* ! HAVE_GETRUSAGE */ 4281#else /* ! HAVE_GETRUSAGE */
4281#ifdef WINDOWSNT 4282#ifdef WINDOWSNT
4282 return w32_get_internal_run_time (); 4283 return w32_get_internal_run_time ();