gettimeofday.c 302 B

1234567891011121314
  1. #include <sys/time.h>
  2. #include <stdio.h>
  3. #include "test_helpers.h"
  4. int main(void) {
  5. struct timeval tv;
  6. // gettimeofday always returns 0, no errors are defined
  7. int gtod = gettimeofday(&tv, NULL);
  8. UNEXP_IF(gettimeofday, gtod, != 0);
  9. printf("%ld: %ld\n", tv.tv_sec, tv.tv_usec);
  10. }