summaryrefslogtreecommitdiff
path: root/libs/hwui/tests
diff options
context:
space:
mode:
authorJerome Gaillard <jgaillard@google.com>2019-06-14 12:58:57 +0100
committerJerome Gaillard <jgaillard@google.com>2019-06-14 12:07:36 +0000
commite218c6928508ef72de2cc5c8b89de0f250a3e68c (patch)
tree22713615fad3dda93063795c97b41f281b6ff745 /libs/hwui/tests
parentf06c22660f41e307cb4a1a70ac9f93f490e68870 (diff)
Replace CLOCK_MONOTONIC with SYSTEM_TIME_MONOTONIC
Using SYSTEM_TIME_MONOTONIC works for Android (where it translates to CLOCK_MONOTONIC) and host targets, while CLOCK_MONOTONIC is not defined on macOS. Bug: 117921091 Test: existing tests should pass Change-Id: I1fad472881830fb0701a320cf37319e083932ad4
Diffstat (limited to 'libs/hwui/tests')
-rw-r--r--libs/hwui/tests/macrobench/TestSceneRunner.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/tests/macrobench/TestSceneRunner.cpp b/libs/hwui/tests/macrobench/TestSceneRunner.cpp
index 9c845f04e820..22d5abbd3dbc 100644
--- a/libs/hwui/tests/macrobench/TestSceneRunner.cpp
+++ b/libs/hwui/tests/macrobench/TestSceneRunner.cpp
@@ -146,7 +146,7 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
}
for (int i = 0; i < warmupFrameCount; i++) {
testContext.waitForVsync();
- nsecs_t vsync = systemTime(CLOCK_MONOTONIC);
+ nsecs_t vsync = systemTime(SYSTEM_TIME_MONOTONIC);
UiFrameInfoBuilder(proxy->frameInfo()).setVsync(vsync, vsync);
proxy->syncAndDrawFrame();
}
@@ -161,10 +161,10 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
ModifiedMovingAverage<double> avgMs(opts.reportFrametimeWeight);
- nsecs_t start = systemTime(CLOCK_MONOTONIC);
+ nsecs_t start = systemTime(SYSTEM_TIME_MONOTONIC);
for (int i = 0; i < opts.count; i++) {
testContext.waitForVsync();
- nsecs_t vsync = systemTime(CLOCK_MONOTONIC);
+ nsecs_t vsync = systemTime(SYSTEM_TIME_MONOTONIC);
{
ATRACE_NAME("UI-Draw Frame");
UiFrameInfoBuilder(proxy->frameInfo()).setVsync(vsync, vsync);
@@ -173,7 +173,7 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
}
if (opts.reportFrametimeWeight) {
proxy->fence();
- nsecs_t done = systemTime(CLOCK_MONOTONIC);
+ nsecs_t done = systemTime(SYSTEM_TIME_MONOTONIC);
avgMs.add((done - vsync) / 1000000.0);
if (i % 10 == 9) {
printf("Average frametime %.3fms\n", avgMs.average());
@@ -181,7 +181,7 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
}
}
proxy->fence();
- nsecs_t end = systemTime(CLOCK_MONOTONIC);
+ nsecs_t end = systemTime(SYSTEM_TIME_MONOTONIC);
if (reporter) {
outputBenchmarkReport(info, opts, reporter, proxy.get(), (end - start) / (double)s2ns(1));