MCPcopy Create free account
hub / github.com/F-Stack/f-stack / start_timer

Method start_timer

adapter/micro_thread/heap_timer.cpp:49–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49bool CTimerMng::start_timer(CTimerNotify* timerable, uint32_t interval)
50{
51 if (!_heap || !timerable) {
52 return false;
53 }
54
55 utime64_t now_ms = MtFrame::Instance()->GetLastClock();
56 timerable->set_expired_time(now_ms + interval);
57 int32_t ret = _heap->HeapPush(timerable);
58 if (ret < 0) {
59 MTLOG_ERROR("timer start failed(%p), ret(%d)", timerable, ret);
60 return false;
61 }
62
63 return true;
64}
65
66void CTimerMng::stop_timer(CTimerNotify* timerable)
67{

Callers 2

StartTimerMethod · 0.80
IdleAttachMethod · 0.80

Calls 3

GetLastClockMethod · 0.80
set_expired_timeMethod · 0.80
HeapPushMethod · 0.80

Tested by

no test coverage detected