summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-11-25 15:11:59 -0800
committerElliott Hughes <enh@google.com>2014-11-25 15:11:59 -0800
commit42c569224a6aba3fa0ee1176909d06438073675a (patch)
tree1d6e8ff1b66502c5ada8c96d96b8ecc82544c5c5 /core/jni
parentfc54573373ff965aa40cccdc1ab11c1c880c8930 (diff)
downloadframeworks_base-42c569224a6aba3fa0ee1176909d06438073675a.zip
frameworks_base-42c569224a6aba3fa0ee1176909d06438073675a.tar.gz
frameworks_base-42c569224a6aba3fa0ee1176909d06438073675a.tar.bz2
We have POSIX clocks.
Change-Id: I70f82074f8c14a26c4ed7eb912ddf6d7da44c168
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_os_SystemClock.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/core/jni/android_os_SystemClock.cpp b/core/jni/android_os_SystemClock.cpp
index 1d45605..dfe024e 100644
--- a/core/jni/android_os_SystemClock.cpp
+++ b/core/jni/android_os_SystemClock.cpp
@@ -60,18 +60,11 @@ static jlong android_os_SystemClock_elapsedRealtime(JNIEnv* env,
static jlong android_os_SystemClock_currentThreadTimeMillis(JNIEnv* env,
jobject clazz)
{
-#if defined(HAVE_POSIX_CLOCKS)
struct timespec tm;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tm);
return tm.tv_sec * 1000LL + tm.tv_nsec / 1000000;
-#else
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
- return tv.tv_sec * 1000LL + tv.tv_usec / 1000;
-#endif
}
/*
@@ -80,18 +73,11 @@ static jlong android_os_SystemClock_currentThreadTimeMillis(JNIEnv* env,
static jlong android_os_SystemClock_currentThreadTimeMicro(JNIEnv* env,
jobject clazz)
{
-#if defined(HAVE_POSIX_CLOCKS)
struct timespec tm;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tm);
return tm.tv_sec * 1000000LL + tm.tv_nsec / 1000;
-#else
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
- return tv.tv_sec * 1000000LL + tv.tv_nsec / 1000;
-#endif
}
/*