aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-06-27 22:07:36 +0200
committerDavid Robillard <d@drobilla.net>2019-06-27 22:48:43 +0200
commit664b49726136f861d695b96f4e285f9afcdc7127 (patch)
treefd08f9f13b9f89c782dc88363a92a161f54f7b42 /pugl/pugl_osx.m
parentbd5d643192e189e2f4d34ecc1b93a7758cfeb583 (diff)
downloadpugl-664b49726136f861d695b96f4e285f9afcdc7127.tar.gz
pugl-664b49726136f861d695b96f4e285f9afcdc7127.tar.bz2
pugl-664b49726136f861d695b96f4e285f9afcdc7127.zip
Add puglGetTime()
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index 02bf46a..1503034 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -27,6 +27,7 @@
#import <Cocoa/Cocoa.h>
#include <stdlib.h>
+#include <time.h>
#undef PUGL_HAVE_CAIRO
@@ -726,6 +727,14 @@ puglGetProcAddress(const char *name)
return func;
}
+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)
{