diff options
-rw-r--r-- | src/x11.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1872,7 +1872,10 @@ double puglGetTime(const PuglWorld* const world) { struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); + if (clock_gettime(CLOCK_MONOTONIC, &ts)) { + return 0.0; + } + return ((double)ts.tv_sec + (double)ts.tv_nsec / 1000000000.0) - world->startTime; } |