chore(timer): timestamp update every 10ms

This commit is contained in:
fengzero
2022-10-19 09:20:01 +00:00
parent 30738fb4e0
commit cb1f3cae4a
2 changed files with 1 additions and 4 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ neu_adapter_t *neu_adapter_create(neu_adapter_info_t *info)
neu_event_io_param_t param = { 0 };
neu_event_timer_param_t timer_param = {
.second = 0,
.millisecond = 100,
.millisecond = 10,
.cb = update_timestamp,
};
-3
View File
@@ -103,10 +103,7 @@ static void *event_loop(void *arg)
assert(size != -1);
nng_mtx_lock(data->ctx.timer->mtx);
epoll_ctl(epoll_fd, EPOLL_CTL_DEL, data->fd, NULL);
ret = data->callback.timer(data->usr_data);
timerfd_settime(data->fd, 0, &data->ctx.timer->value, NULL);
epoll_ctl(epoll_fd, EPOLL_CTL_ADD, data->fd, &event);
nng_mtx_unlock(data->ctx.timer->mtx);
}
break;