diff options
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r-- | pugl/pugl_osx.m | 9 |
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) { |