/* */ #include "RequestSlot.h" namespace aria2 { RequestSlot RequestSlot::nullSlot = RequestSlot(); void RequestSlot::setDispatchedTime() { dispatchedTime.reset(); } void RequestSlot::setDispatchedTime(time_t secFromEpoch) { dispatchedTime.setTimeInSec(secFromEpoch); } bool RequestSlot::isTimeout(const struct timeval& now, time_t timeoutSec) const { return dispatchedTime.difference(now) >= timeoutSec; } unsigned int RequestSlot::getLatencyInMillis() const { return dispatchedTime.differenceInMillis(); } bool RequestSlot::isNull(const RequestSlot& requestSlot) { return requestSlot.index == 0 && requestSlot.begin == 0&& requestSlot.length == 0; } } // namespace aria2