tv_sub.c 209 B

123456789101112
  1. #include "unp.h"
  2. void
  3. tv_sub(struct timeval *out, struct timeval *in)
  4. {
  5. if ( (out->tv_usec -= in->tv_usec) < 0) { /* out -= in */
  6. --out->tv_sec;
  7. out->tv_usec += 1000000;
  8. }
  9. out->tv_sec -= in->tv_sec;
  10. }