diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2017-01-24 02:07:43 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2017-01-24 02:07:43 +0200 |
commit | f77a40519f5b40aa29dbf3f8d857001b7cd9e848 (patch) | |
tree | 81fdbb1ec0e64d221ba983df34c27bbe9720b67d | |
parent | df6ec90e48c80b981cd80adf1eeaebb09c28f981 (diff) |
Add performance warning
-rw-r--r-- | glcapture.c | 6 |
1 files changed, 6 insertions, 0 deletions
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* |