summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/TimeLord.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-02-19 14:36:50 -0800
committerJohn Reck <jreck@google.com>2015-02-20 08:27:38 -0800
commitba6adf66d3c44c0aa2fd8a224862ff1901d64300 (patch)
tree8172a893f00caa283cf0386dd3d585ca8fac867c /libs/hwui/renderthread/TimeLord.cpp
parent004a46eb171bc86a3d40eb8fc6a4d9eed48027c7 (diff)
Initial attempt at jank-tracking stat collection
Is a bit naive, perhaps overly aggressive, but sorta works Change-Id: I01a774e00dbe681439c02557d9728ae43c45ce50
Diffstat (limited to 'libs/hwui/renderthread/TimeLord.cpp')
-rw-r--r--libs/hwui/renderthread/TimeLord.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/renderthread/TimeLord.cpp b/libs/hwui/renderthread/TimeLord.cpp
index f18749317ab6..f846d6a44473 100644
--- a/libs/hwui/renderthread/TimeLord.cpp
+++ b/libs/hwui/renderthread/TimeLord.cpp
@@ -32,7 +32,7 @@ bool TimeLord::vsyncReceived(nsecs_t vsync) {
return false;
}
-nsecs_t TimeLord::computeFrameTimeMs() {
+nsecs_t TimeLord::computeFrameTimeNanos() {
// Logic copied from Choreographer.java
nsecs_t now = systemTime(CLOCK_MONOTONIC);
nsecs_t jitterNanos = now - mFrameTimeNanos;
@@ -40,7 +40,11 @@ nsecs_t TimeLord::computeFrameTimeMs() {
nsecs_t lastFrameOffset = jitterNanos % mFrameIntervalNanos;
mFrameTimeNanos = now - lastFrameOffset;
}
- return nanoseconds_to_milliseconds(mFrameTimeNanos);
+ return mFrameTimeNanos;
+}
+
+nsecs_t TimeLord::computeFrameTimeMs() {
+ return nanoseconds_to_milliseconds(computeFrameTimeNanos());
}
} /* namespace renderthread */