学会使用timerfd做定时任务


#include

int timerfd_create()

int timerfd_settime()

int timerfd_gettime()

timerfd的好处在于可以通过epoll来判断定时事件是否ready.