time.c 559 B

123456789101112131415161718192021
  1. #include <stdlib.h>
  2. #include <sys/time.h>
  3. unsigned long long os_usecs(void)
  4. {
  5. struct timeval tv;
  6. gettimeofday(&tv, NULL);
  7. return((unsigned long long) tv.tv_sec * 1000000 + tv.tv_usec);
  8. }
  9. /*
  10. * Overrides for Emacs so that we follow Linus's tabbing style.
  11. * Emacs will notice this stuff at the end of the file and automatically
  12. * adjust the settings for this buffer only. This must remain at the end
  13. * of the file.
  14. * ---------------------------------------------------------------------------
  15. * Local variables:
  16. * c-file-style: "linux"
  17. * End:
  18. */