MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / pollTimers

Method pollTimers

src/ui/timer.cpp:75–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void Timer::pollTimers()
76{
77 // Generate messages for timers
78 if (!timers.empty()) {
79 base::tick_t t = base::current_tick();
80
81 for (Timers::iterator it=timers.begin(), end=timers.end(); it != end; ++it) {
82 Timer* timer = *it;
83 if (timer && timer->isRunning()) {
84 int64_t count = ((t - timer->m_lastTick) / timer->m_interval);
85 if (count > 0) {
86 timer->m_lastTick += count * timer->m_interval;
87
88 ASSERT(timer->m_owner != nullptr);
89
90 Message* msg = new TimerMessage(count, timer);
91 msg->addRecipient(timer->m_owner);
92 Manager::getDefault()->enqueueMessage(msg);
93 }
94 }
95 }
96 }
97}
98
99void Timer::checkNoTimers()
100{

Callers

nothing calls this directly

Calls 7

current_tickFunction · 0.85
addRecipientMethod · 0.80
enqueueMessageMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isRunningMethod · 0.45

Tested by

no test coverage detected