api-impl-jni: android_os_SystemClock.c: use CLOCK_MONOTONIC to match System.nanoTime

This commit is contained in:
Mis012
2024-02-22 14:25:29 +01:00
parent da0971e88f
commit 52886e0541

View File

@@ -13,7 +13,7 @@ JNIEXPORT jlong JNICALL Java_android_os_SystemClock_elapsedRealtime(JNIEnv *env,
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_uptimeMillis(JNIEnv *env, jclass this)
{
struct timespec t;
clock_gettime(CLOCK_REALTIME, &t);
return t.tv_sec * 1000 + lround(t.tv_nsec / 1e6);
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
return now.tv_sec * 1000 + lround(now.tv_nsec / 1e6);
}