timemanager: Remove timer minimum timeout.

This commit is contained in:
joevt 2023-10-17 19:47:51 -07:00 committed by dingusdev
parent f5dcaebbf8
commit 014aa90462
2 changed files with 1 additions and 13 deletions

View File

@ -30,10 +30,6 @@ TimerManager* TimerManager::timer_manager;
uint32_t TimerManager::add_oneshot_timer(uint64_t timeout, timer_cb cb) uint32_t TimerManager::add_oneshot_timer(uint64_t timeout, timer_cb cb)
{ {
if (timeout <= MIN_TIMEOUT_NS) {
LOG_F(WARNING, "One-shot timer too short, timeout=%llu ns", (long long unsigned)timeout);
}
TimerInfo* ti = new TimerInfo; TimerInfo* ti = new TimerInfo;
ti->id = ++this->id; ti->id = ++this->id;
@ -77,11 +73,6 @@ uint32_t TimerManager::add_immediate_timer(timer_cb cb) {
uint32_t TimerManager::add_cyclic_timer(uint64_t interval, uint64_t delay, timer_cb cb) uint32_t TimerManager::add_cyclic_timer(uint64_t interval, uint64_t delay, timer_cb cb)
{ {
if (!interval || interval <= MIN_TIMEOUT_NS) {
LOG_F(WARNING, "Cyclic timer interval too short, timeout=%llu ns",
(long long unsigned)interval);
}
TimerInfo* ti = new TimerInfo; TimerInfo* ti = new TimerInfo;
ti->id = ++this->id; ti->id = ++this->id;
@ -129,8 +120,7 @@ uint64_t TimerManager::process_timers(uint64_t time_now)
// scan for expired timers // scan for expired timers
cur_timer = this->timer_queue.top().get(); cur_timer = this->timer_queue.top().get();
while (cur_timer->timeout_ns <= time_now || while (cur_timer->timeout_ns <= time_now) {
cur_timer->timeout_ns <= (time_now + MIN_TIMEOUT_NS)) {
timer_cb cb = cur_timer->cb; timer_cb cb = cur_timer->cb;
// re-arm cyclic timers // re-arm cyclic timers

View File

@ -31,8 +31,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
using namespace std; using namespace std;
#define MIN_TIMEOUT_NS 200
#define NS_PER_SEC 1E9 #define NS_PER_SEC 1E9
#define USEC_PER_SEC 1E6 #define USEC_PER_SEC 1E6
#define NS_PER_USEC 1000UL #define NS_PER_USEC 1000UL