27 #ifndef AsyncComm_PollTimeout_h
28 #define AsyncComm_PollTimeout_h
56 assert(std::chrono::operator<=(now, expire));
57 auto diff_usec = expire - now;
59 duration_ts.tv_nsec = (diff_usec.count() % 1000000) * 1000;
61 duration_millis = std::chrono::duration_cast<std::chrono::milliseconds>(diff_usec);
96 #endif // AsyncComm_PollTimeout_h
std::chrono::milliseconds duration_millis
Duration until next timeout in milliseconds.
struct timespec duration_ts
timespec structure holding duration until next timeout
chrono::time_point< fast_clock > time_point
Maintains next timeout for event polling loop.
struct timespec * ts_ptr
Pointer to to duration_ts or 0 if indefinite.
void set(ClockT::time_point now, ClockT::time_point expire)
Sets the next timeout.
int get_millis()
Gets duration until next timeout in the form of milliseconds.
PollTimeout()
Constructor.
void set_indefinite()
Sets the next timeout to be an indefinite time in the future.
struct timespec * get_timespec()
Gets duration until next timeout in the form of a pointer to timespec.