mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
CEventLoop: Don't call gettimeofday() at all if there are no timers.
This commit is contained in:
parent
ae3ec3fc37
commit
3b986da643
Notes:
sideshowbarker
2024-07-19 14:40:01 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3b986da6431
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue