问题
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()?
来源:https://stackoverflow.com/questions/601012/setting-an-alarm-in-milliseconds-in-c