diff options
author | Sven Gothel <[email protected]> | 2013-06-17 04:09:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-17 04:09:52 +0200 |
commit | c3dc7fbdb9437f773146926b41003df32ba756d1 (patch) | |
tree | af2e2c9f9138eae978e9f9611b001e2a5924ce45 /src/jogl/native | |
parent | 92fce556bf9c3d8f1e99bf79f48631d58829c523 (diff) |
timespec.c/h: Add 'long timespec_microseconds(..)'
Diffstat (limited to 'src/jogl/native')
-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 */ |