From fb6c236d40fed9837d62ae40ff2e43d6de314547 Mon Sep 17 00:00:00 2001 From: XieHan Date: Fri, 20 Nov 2020 18:26:33 +0800 Subject: [PATCH] update create_timer_task --- src/factory/WFTaskFactory.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/factory/WFTaskFactory.inl b/src/factory/WFTaskFactory.inl index 39ebdc54..ae298737 100644 --- a/src/factory/WFTaskFactory.inl +++ b/src/factory/WFTaskFactory.inl @@ -62,8 +62,8 @@ inline WFTimerTask *WFTaskFactory::create_timer_task(unsigned int microseconds, timer_callback_t callback) { struct timespec value = { - .tv_sec = (time_t)microseconds / 1000000, - .tv_nsec = (long)microseconds % 1000000 * 1000 + .tv_sec = microseconds / 1000000, + .tv_nsec = microseconds % 1000000 * 1000 }; return new __WFTimerTask(&value, WFGlobal::get_scheduler(), std::move(callback));