aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/pugl_x11.c')
-rw-r--r--pugl/pugl_x11.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c
index 6563805..2fd6e92 100644
--- a/pugl/pugl_x11.c
+++ b/pugl/pugl_x11.c
@@ -20,6 +20,7 @@
@file pugl_x11.c X11 Pugl Implementation.
*/
+#define _POSIX_C_SOURCE 199309L
#include "pugl/pugl_internal.h"
#include "pugl/pugl_x11.h"
@@ -38,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#ifndef MIN
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -516,6 +518,14 @@ puglProcessEvents(PuglView* view)
return PUGL_SUCCESS;
}
+double
+puglGetTime(PuglView* view)
+{
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return (double)ts.tv_sec + ts.tv_nsec / 1000000000.0;
+}
+
void
puglPostRedisplay(PuglView* view)
{