X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ftimespec.h;h=acf815c8dbceb7f5bd27d18553a951600f373a51;hb=50901279d8e42ea4bccc2eef0a6b11e7c3dde4cf;hp=d5b0996b8cfa2d33cd81f6ded459d3c514e501a0;hpb=e115de06311db0fede74181edc5fa1e3baf5381b;p=gnulib.git diff --git a/lib/timespec.h b/lib/timespec.h index d5b0996b8..acf815c8d 100644 --- a/lib/timespec.h +++ b/lib/timespec.h @@ -65,6 +65,17 @@ timespec_sign (struct timespec a) return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; } +struct timespec timespec_add (struct timespec, struct timespec); +struct timespec timespec_sub (struct timespec, struct timespec); +struct timespec dtotimespec (double); + +/* Return an approximation to A, of type 'double'. */ +static inline double +timespectod (struct timespec a) +{ + return a.tv_sec + a.tv_nsec / 1e9; +} + void gettime (struct timespec *); int settime (struct timespec const *);