فهرست منبع

Cygwin somehow does not have CLOCK_MONOTONIC_RAW.

Andy Li 6 سال پیش
والد
کامیت
06d39d623f
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      libs/extc/extc_stubs.c

+ 5 - 1
libs/extc/extc_stubs.c

@@ -522,10 +522,14 @@ CAMLprim value sys_time() {
 	elapsedNano = time * sTimebaseInfo.numer / sTimebaseInfo.denom;
 
 	return caml_copy_double(time / 1000000000.0);
-#else
+#elif defined CLOCK_MONOTONIC_RAW
 	struct timespec t;
 	clock_gettime(CLOCK_MONOTONIC_RAW, &t);
 	return caml_copy_double(TimeSpecToSeconds(t));
+#else
+	struct timespec t;
+	clock_gettime(CLOCK_MONOTONIC, &t);
+	return caml_copy_double(TimeSpecToSeconds(t));
 #endif
 }