Microsecond is 10^(-6)s, not 10^(-9)s

This commit is contained in:
Maxime Coste 2014-12-03 18:57:33 +00:00
parent 995c7b4634
commit d437ae0ecf

View File

@ -86,7 +86,7 @@ void EventManager::handle_next_events(EventMode mode)
using namespace std::chrono;
auto timeout = duration_cast<microseconds>(next_timer - Clock::now()).count();
constexpr auto us = 1000000000ll;
constexpr auto us = 1000000;
timeval tv{ (time_t)(timeout / us), (suseconds_t)(timeout % us) };
int res = select(max_fd + 1, &rfds, nullptr, nullptr, &tv);