summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2012-07-19 09:17:24 -0700
committerNick Pelly <npelly@google.com>2012-07-19 16:06:21 -0700
commit074cd0c0765d1aec5a4ff5ac460f0685ae067fb1 (patch)
tree318371eaf5d0e59babc3338889b83e3d5731c742 /include
parentdf5cbd76224ea1facb7cfb499f4d522e55753774 (diff)
downloadframeworks_native-074cd0c0765d1aec5a4ff5ac460f0685ae067fb1.zip
frameworks_native-074cd0c0765d1aec5a4ff5ac460f0685ae067fb1.tar.gz
frameworks_native-074cd0c0765d1aec5a4ff5ac460f0685ae067fb1.tar.bz2
Add elapsedRealtimeNano(), and use CLOCK_BOOTTIME where possible.
Change-Id: I4231c8ca32663e6e2cb5b7c126d091f837373807
Diffstat (limited to 'include')
-rw-r--r--include/utils/SystemClock.h1
-rw-r--r--include/utils/Timers.h5
2 files changed, 4 insertions, 2 deletions
diff --git a/include/utils/SystemClock.h b/include/utils/SystemClock.h
index 7c319be..d75264c 100644
--- a/include/utils/SystemClock.h
+++ b/include/utils/SystemClock.h
@@ -25,6 +25,7 @@ namespace android {
int setCurrentTimeMillis(int64_t millis);
int64_t uptimeMillis();
int64_t elapsedRealtime();
+int64_t elapsedRealtimeNano();
}; // namespace android
diff --git a/include/utils/Timers.h b/include/utils/Timers.h
index 8b4d322..92f66c9 100644
--- a/include/utils/Timers.h
+++ b/include/utils/Timers.h
@@ -78,9 +78,10 @@ enum {
SYSTEM_TIME_REALTIME = 0, // system-wide realtime clock
SYSTEM_TIME_MONOTONIC = 1, // monotonic time since unspecified starting point
SYSTEM_TIME_PROCESS = 2, // high-resolution per-process clock
- SYSTEM_TIME_THREAD = 3 // high-resolution per-thread clock
+ SYSTEM_TIME_THREAD = 3, // high-resolution per-thread clock
+ SYSTEM_TIME_BOOTTIME = 4 // same as SYSTEM_TIME_MONOTONIC, but including CPU suspend time
};
-
+
// return the system-time according to the specified clock
#ifdef __cplusplus
nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC);