16 #ifndef TIMEOUT_ADJUST_FUNC_H 17 #define TIMEOUT_ADJUST_FUNC_H 30 static std::chrono::steady_clock::duration
35 const std::chrono::steady_clock::duration new_timeout{ timeout + timeout_increase };
36 const bool timeout_overflow{ new_timeout > max_timeout };
37 return timeout_overflow ? max_timeout : new_timeout;
42 #endif // TIMEOUT_ADJUST_FUNC_H constexpr auto DEFAULT_TIMEOUT_INCREASE
static std::chrono::steady_clock::duration adjustTimeout(const std::chrono::steady_clock::duration &timeout, const std::chrono::steady_clock::duration timeout_increase=DEFAULT_TIMEOUT_INCREASE, const std::chrono::steady_clock::duration max_timeout=DEFAULT_MAX_TIMEOUT)
Increases the given timeout by the specified timeout increase. If the new timeout exceeds the max tim...
constexpr auto DEFAULT_MAX_TIMEOUT