Setting an alarm in milliseconds in C

2019-04-30 04:05发布

问题:

I currently have some C code that uses sigaction to associate a handler to the SIGALRM signal. Then I do alarm(TIME_OUT_IN_SECONDS). Problem is, I need milliseconds, not seconds and alarm takes an integer. How can I set the signal to fire off in milliseconds?

回答1:

How about using setitimer()?



标签: c signals