_timeval.h 620 B

1234567891011121314151617181920212223
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _TIMEVAL_DEFINED
  7. #define _TIMEVAL_DEFINED
  8. struct timeval
  9. {
  10. long tv_sec;
  11. long tv_usec;
  12. };
  13. #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
  14. #define timercmp(tvp,uvp,cmp) \
  15. ((tvp)->tv_sec cmp (uvp)->tv_sec || \
  16. ((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec))
  17. #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
  18. #endif /* _TIMEVAL_DEFINED */