diff options
-rw-r--r-- | src/jogl/native/timespec.c | 5 | ||||
-rw-r--r-- | src/jogl/native/timespec.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/jogl/native/timespec.c b/src/jogl/native/timespec.c index 50f0ca8c5..a69f4635e 100644 --- a/src/jogl/native/timespec.c +++ b/src/jogl/native/timespec.c @@ -75,3 +75,8 @@ long timespec_milliseconds(struct timespec *a) { return a->tv_sec*1000 + a->tv_nsec/1000000; } + +long timespec_microseconds(struct timespec *a) +{ + return a->tv_sec*1000000 + a->tv_nsec/1000; +} diff --git a/src/jogl/native/timespec.h b/src/jogl/native/timespec.h index f900bfa16..a621562b9 100644 --- a/src/jogl/native/timespec.h +++ b/src/jogl/native/timespec.h @@ -17,4 +17,7 @@ void timespec_subtract(struct timespec *r, struct timespec *a, struct timespec * /** convert the timespec into milliseconds (may overflow) */ long timespec_milliseconds(struct timespec *a); +/** convert the timespec into microseconds (may overflow) */ +long timespec_microseconds(struct timespec *a); + #endif /* _timespec_h */ |