From 664b49726136f861d695b96f4e285f9afcdc7127 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 27 Jun 2019 22:07:36 +0200 Subject: Add puglGetTime() --- pugl/pugl_osx.m | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pugl/pugl_osx.m') 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 #include +#include #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) { -- cgit v1.2.1