MCPcopy Create free account
hub / github.com/caozhiyi/CppNet / SetTimer

Method SetTimer

net/CppNetImpl.cpp:113–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113uint64_t CCppNetImpl::SetTimer(uint32_t interval, const std::function<void(void*)>& func, void* param, bool always) {
114
115 auto actions = _RandomGetActions();
116
117 uint64_t timer_id = 0;
118 timer_id = actions->AddTimerEvent(interval, func, param, always);
119 actions->WakeUp();
120
121 _timer_actions_map[timer_id] = actions;
122
123 return timer_id;
124}
125
126void CCppNetImpl::RemoveTimer(uint64_t timer_id) {
127 auto iter = _timer_actions_map.find(timer_id);

Callers

nothing calls this directly

Calls 2

AddTimerEventMethod · 0.45
WakeUpMethod · 0.45

Tested by

no test coverage detected