timer event libevent添加一个间隔1s持续触发的定时器如下: struct event_base *base = event_base_new(); struct event *timer_ev = event_new(base , -1, EV_PERSIST, cb_func, NULL ); struct timeval one_sec = {1,0}; event_add(timer_ev , &one_sec); event_base_dispatch(base );…