~bl4ckb0ne/wxrc

f7e48be32d34e566bc68fea8ef9f711322a1f296 — Simon Zeni 1 year, 4 months ago 30b4847
wxrc/openxr: print compositor FPS
1 files changed, 21 insertions(+), 0 deletions(-)

M wxrc/openxr.c
M wxrc/openxr.c => wxrc/openxr.c +21 -0
@@ 1001,6 1001,27 @@ wxrc_openxr_run(void *arg)
		}

		TracyCZoneEnd(inner)

/* TODO find a better way to display compositor FPS on the hmd/cli
		static uint32_t benchmark_time = 0, frames = 0;
		static const uint32_t interval = 5;

		struct timespec now;
		clock_gettime(CLOCK_MONOTONIC, &now);

		uint32_t time = (uint32_t)now.tv_sec * 1000 + now.tv_nsec / 1000000;

		if (frames == 0) {
			benchmark_time = time;
		}
		if (time - benchmark_time > (interval * 1000)) {
			printf("%d frames in %d seconds: %f fps\n", frames, interval,
				(float) frames / interval);
			benchmark_time = time;
			frames = 0;
		}
		frames++;
*/
	} while (server->running);

oxr_fail: