11/19/2023 0 Comments Unix signals itimer![]() The above code uses the sleep() function to wait for three seconds. Setitimer(ITIMER_REAL, &new_timer, &old_timer) Įrrorf( "sleep error %s", strerror(errno)) Printf( "Signal %d caught on %li.%03li ", signum, now.tv_sec, now.tv_usec / 1000) Here is an example of defining the signal handler function with the debug header: # include You'll need to pass a value using this struct as the second argument to the settimer function. If you want to set up an interval timer, you'll need to use the itimerval struct. Int getitimer ( int which, struct itimerval *value) Int setitimer ( int which, const struct itimerval *newValue, struct itimerval *oldValue)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |