CEventLoop: Don't call gettimeofday() at all if there are no timers.

This commit is contained in:
Andreas Kling 2019-04-18 13:23:59 +02:00
parent ae3ec3fc37
commit 3b986da643
Notes: sideshowbarker 2024-07-19 14:40:01 +09:00

View file

@ -171,7 +171,8 @@ void CEventLoop::wait_for_event()
}
timeval now;
gettimeofday(&now, nullptr);
if (!s_timers->is_empty())
gettimeofday(&now, nullptr);
for (auto& it : *s_timers) {
auto& timer = *it.value;