time.pxd 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html
  2. from posix.types cimport suseconds_t, time_t, clockid_t, timer_t
  3. from posix.signal cimport sigevent
  4. cdef extern from "<sys/time.h>" nogil:
  5. enum: CLOCK_REALTIME
  6. enum: TIMER_ABSTIME
  7. enum: CLOCK_MONOTONIC
  8. # FreeBSD-specific clocks
  9. enum: CLOCK_UPTIME
  10. enum: CLOCK_UPTIME_PRECISE
  11. enum: CLOCK_UPTIME_FAST
  12. enum: CLOCK_REALTIME_PRECISE
  13. enum: CLOCK_REALTIME_FAST
  14. enum: CLOCK_MONOTONIC_PRECISE
  15. enum: CLOCK_MONOTONIC_FAST
  16. enum: CLOCK_SECOND
  17. # Linux-specific clocks
  18. enum: CLOCK_PROCESS_CPUTIME_ID
  19. enum: CLOCK_THREAD_CPUTIME_ID
  20. enum: CLOCK_MONOTONIC_RAW
  21. enum: CLOCK_REALTIME_COARSE
  22. enum: CLOCK_MONOTONIC_COARSE
  23. enum: CLOCK_BOOTTIME
  24. enum: CLOCK_REALTIME_ALARM
  25. enum: CLOCK_BOOTTIME_ALARM
  26. enum: ITIMER_REAL
  27. enum: ITIMER_VIRTUAL
  28. enum: ITIMER_PROF
  29. cdef struct timezone:
  30. int tz_minuteswest
  31. int dsttime
  32. cdef struct timeval:
  33. time_t tv_sec
  34. suseconds_t tv_usec
  35. cdef struct timespec:
  36. time_t tv_sec
  37. long tv_nsec
  38. cdef struct itimerval:
  39. timeval it_interval
  40. timeval it_value
  41. cdef struct itimerspec:
  42. timespec it_interval
  43. timespec it_value
  44. int nanosleep(const timespec *, timespec *)
  45. int getitimer(int, itimerval *)
  46. int gettimeofday(timeval *tp, timezone *tzp)
  47. int setitimer(int, const itimerval *, itimerval *)
  48. int clock_getcpuclockid(pid_t, clockid_t *)
  49. int clock_getres(clockid_t, timespec *)
  50. int clock_gettime(clockid_t, timespec *)
  51. int clock_nanosleep(clockid_t, int, const timespec *, timespec *)
  52. int clock_settime(clockid_t, const timespec *)
  53. int timer_create(clockid_t, sigevent *, timer_t *)
  54. int timer_delete(timer_t)
  55. int timer_gettime(timer_t, itimerspec *)
  56. int timer_getoverrun(timer_t)
  57. int timer_settime(timer_t, int, const itimerspec *, itimerspec *)