2
0
Эх сурвалжийг харах

Cygwin somehow does not have CLOCK_MONOTONIC_RAW.

Andy Li 6 жил өмнө
parent
commit
06d39d623f

+ 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
 }