Advertisement
Guest User

vinzzz

a guest
Dec 9th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. void TimerInit(void)
  2. {
  3.  
  4. printf("------------------- TimerInit -----------------\n");
  5.  
  6. struct sigevent sigev;
  7. // Take first absolute time ref.
  8. if(gettimeofday(&last_sig,NULL)){
  9. perror("gettimeofday()");
  10. }
  11.  
  12. memset (&sigev, 0, sizeof (struct sigevent));
  13. sigev.sigev_value.sival_int = 0;
  14. sigev.sigev_notify = SIGEV_THREAD;
  15.  
  16. sigev.sigev_notify_attributes = NULL;
  17. sigev.sigev_notify_function = timer_notify;
  18.  
  19. if(timer_create (CLOCK_REALTIME, &sigev, &timer)) {
  20.  
  21. perror("timer_create()");
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement