Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I have started a periodic timer by setitimer() system call. Now, at application exit, I want to cancel the timer started for cleanup purpose. can any one suggest me ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    1

    How to cancel a periodic timer started by setitimer() system call?

    Hi,

    I have started a periodic timer by setitimer() system call.

    Now, at application exit, I want to cancel the timer started for cleanup purpose.

    can any one suggest me the way for implementing this?

    regards

    Arpit

  2. #2
    Just Joined!
    Join Date
    Jun 2008
    Posts
    39
    Get the pid of the running process, and then issue the command "kill <pid>".

  3. #3
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    If you're using setitimer(), you're using it for one or more of these kinds of timing:
    1. ITIMER_REAL
    2. ITIMER_VIRTUAL
    3. ITIMER_PROF

    For each kind that you're actually using (or for all three, if you want to keep your code simple), call setitimer() with the second parameter as a pointer to something whose fields:
    1. it_interval.tv_sec
    2. it_interval.tv_usec
    3. it_value.tv_sec
    4. it_value.tv_usec

    are all set to zero.

    Hope this helps.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...