Skip to content

Instantly share code, notes, and snippets.

@rahulg
Created June 29, 2016 11:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rahulg/baa500e84136f0965e9ade2fb36b90ba to your computer and use it in GitHub Desktop.
Save rahulg/baa500e84136f0965e9ade2fb36b90ba to your computer and use it in GitHub Desktop.
diff --git a/libguile/stime.c b/libguile/stime.c
index f430ca4..8b810a7 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -834,6 +834,10 @@ scm_init_stime()
#ifdef HAVE_POSIX_CPUTIME
{
+#ifdef __APPLE__
+ if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)
+ get_internal_run_time = get_internal_run_time_posix_timer;
+#else
clockid_t dummy;
/* Only use the _POSIX_CPUTIME clock if it's going to work across
@@ -843,6 +847,7 @@ scm_init_stime()
get_internal_run_time = get_internal_run_time_posix_timer;
else
errno = 0;
+#endif
}
#endif /* HAVE_POSIX_CPUTIME */
#endif /* HAVE_CLOCKTIME */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment