From 55cbb2f5965361a7c47899340a12d3b38599f811 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 26 Jan 2017 11:23:28 +0200 Subject: Output calculated FPS in 5 second intervals --- glcapture.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/glcapture.c b/glcapture.c index 5ac6836..5344215 100644 --- a/glcapture.c +++ b/glcapture.c @@ -508,11 +508,16 @@ draw_indicator(const GLint view[4]) static void swap_buffers(void) { - static __thread uint64_t last_time; + static __thread uint64_t last_time, fps_time; const uint64_t ts = get_time_ns(); const uint32_t fps = (last_time > 0 ? 1.0 / ((ts - last_time) / 1e9) : TARGET_FPS); last_time = ts; + if ((ts - fps_time) / 1e9 > 5.0) { + WARNX("FPS: %u", fps); + fps_time = ts; + } + void* (*procs[])(const char*) = { (void*)_eglGetProcAddress, (void*)_glXGetProcAddressARB, -- cgit v1.2.3