diff options
Diffstat (limited to 'luni/src/main/native/java_lang_System.cpp')
-rw-r--r-- | luni/src/main/native/java_lang_System.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/luni/src/main/native/java_lang_System.cpp b/luni/src/main/native/java_lang_System.cpp index 0686310..2c48309 100644 --- a/luni/src/main/native/java_lang_System.cpp +++ b/luni/src/main/native/java_lang_System.cpp @@ -94,7 +94,11 @@ static jlong System_currentTimeMillis(JNIEnv*, jclass) { static jlong System_nanoTime(JNIEnv*, jclass) { timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); +#ifdef CLOCK_MONOTONIC_RAW + clock_gettime(CLOCK_MONOTONIC_RAW, &now); +#else // Darwin, say. + clock_gettime(CLOCK_MONOTONIC, &now); +#endif return now.tv_sec * 1000000000LL + now.tv_nsec; } |