diff --git a/NEWS b/NEWS index 1c514b8dc..169a9610b 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ ver 0.21.18 (not yet released) +* reduce unnecessary CPU wakeups ver 0.21.17 (2019/12/16) * protocol diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx index 644cacc39..d3de427c9 100644 --- a/src/event/Loop.cxx +++ b/src/event/Loop.cxx @@ -137,7 +137,8 @@ static constexpr int ExportTimeoutMS(std::chrono::steady_clock::duration timeout) { return timeout >= timeout.zero() - ? int(std::chrono::duration_cast(timeout).count()) + /* round up (+1) to avoid unnecessary wakeups */ + ? int(std::chrono::duration_cast(timeout).count()) + 1 : -1; }