From 301a556b8ece755bbf4f8ec3657e66e0a1dd327f Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 1 Mar 2020 10:09:11 -0800 Subject: add fps reporting --- common.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common.c') diff --git a/common.c b/common.c index b60b833..32fe46a 100644 --- a/common.c +++ b/common.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "common.h" @@ -357,3 +358,10 @@ int link_program(unsigned program) return 0; } + +int64_t get_time_ns(void) +{ + struct timespec tv; + clock_gettime(CLOCK_MONOTONIC, &tv); + return tv.tv_nsec + tv.tv_sec * NSEC_PER_SEC; +} -- cgit v1.2.1