diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-04 22:01:27 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-04 22:33:53 +0300 |
commit | 32c7d8dc04bb2c5ba517aaa05fcd9881420ac7c2 (patch) | |
tree | 3271b8ede97fae022812fa8585d90f42331d40d0 | |
parent | b7c09d442bb6e4ca8d78603a1a508c3bdfcc9082 (diff) |
testpat: use stopwatch
-rw-r--r-- | libkms++util/testpat.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libkms++util/testpat.cpp b/libkms++util/testpat.cpp index 7a15a35..6296b19 100644 --- a/libkms++util/testpat.cpp +++ b/libkms++util/testpat.cpp @@ -1,7 +1,6 @@ //#define DRAW_PERF_PRINT -#include <chrono> #include <cstring> #include <cassert> #include <thread> @@ -9,6 +8,7 @@ #include <kms++.h> #include <kms++util.h> #include <cpuframebuffer.h> +#include "stopwatch.h" #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) @@ -292,18 +292,15 @@ static void draw_test_pattern_impl(IMappedFramebuffer& fb) void draw_test_pattern(IMappedFramebuffer &fb) { #ifdef DRAW_PERF_PRINT - using namespace std::chrono; - - auto t1 = high_resolution_clock::now(); + Stopwatch sw; + sw.start(); #endif draw_test_pattern_impl(fb); #ifdef DRAW_PERF_PRINT - auto t2 = high_resolution_clock::now(); - auto time_span = duration_cast<microseconds>(t2 - t1); - - printf("draw took %u us\n", (unsigned)time_span.count()); + double us = sw.elapsed_us(); + printf("draw took %u us\n", (unsigned)us); #endif } |