Setting an alarm in milliseconds in C

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 04:26:53

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!