summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2020-03-01 10:09:11 -0800
committerRob Clark <robdclark@chromium.org>2020-03-07 09:22:17 -0800
commit301a556b8ece755bbf4f8ec3657e66e0a1dd327f (patch)
tree85271ae1f76ef74bced2b25f49ad511f2e6077ea /common.c
parent163a0b061d3672bc5e0338b16fa11eaa53f63c77 (diff)
downloadkmscube-301a556b8ece755bbf4f8ec3657e66e0a1dd327f.tar.gz
add fps reporting
Diffstat (limited to 'common.c')
-rw-r--r--common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common.c b/common.c
index b60b833..32fe46a 100644
--- a/common.c
+++ b/common.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#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;
+}