From f77a40519f5b40aa29dbf3f8d857001b7cd9e848 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Tue, 24 Jan 2017 02:07:43 +0200 Subject: Add performance warning --- glcapture.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glcapture.c b/glcapture.c index d7b4a78..99db7eb 100644 --- a/glcapture.c +++ b/glcapture.c @@ -468,6 +468,8 @@ draw_indicator(const GLint view[4]) static void swap_buffers(void) { + const uint64_t start = get_time_ns(); + void* (*procs[])(const char*) = { (void*)_eglGetProcAddress, (void*)_glXGetProcAddressARB, @@ -487,6 +489,10 @@ swap_buffers(void) WARNX("glError occured"); reset_capture(&gl); } + + const double ms = (get_time_ns() - start) / 1e6; + if (ms >= 1.0) + WARNX("WARNING: capture took %.2f ms (>=1ms)", ms); } static const char* -- cgit v1.2.3-70-g09d2