diff --git a/src/simplified/xf/core/timeout.cpp b/src/simplified/xf/core/timeout.cpp index f2a6d89..f2e2037 100644 --- a/src/simplified/xf/core/timeout.cpp +++ b/src/simplified/xf/core/timeout.cpp @@ -2,6 +2,7 @@ XFTimeout::XFTimeout(int id, int interval, interface::XFBehavior *pBehavior): XFEvent(XFEventType::Timeout, id), interval_(interval) { + this->setRelTicks(this->getInterval()); setBehavior(pBehavior); } diff --git a/src/simplified/xf/port/common/timeoutmanager.cpp b/src/simplified/xf/port/common/timeoutmanager.cpp index f0d0e87..2c366fe 100644 --- a/src/simplified/xf/port/common/timeoutmanager.cpp +++ b/src/simplified/xf/port/common/timeoutmanager.cpp @@ -34,16 +34,6 @@ XFTimeoutManager::~XFTimeoutManager() { void XFTimeoutManager::addTimeout(XFTimeout *pNewTimeout) { - const int desireInterval = pNewTimeout->getInterval(); - - TimeoutList::iterator it; - do { - // TODO, super algorithm - } while (true); - - int ticks = pNewTimeout->getInterval() / this->tickInterval_; - pNewTimeout->setRelTicks(ticks); - this->pMutex_->lock(); this->timeouts_.push_back(pNewTimeout); this->pMutex_->unlock();