X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/1fe5f5eb5378a47bf0f3451762743c162e40faad..e47950ba3c4ef27ff19d8bb7ad54d779180e96e9:/lunaix-os/kernel/time/timer.c diff --git a/lunaix-os/kernel/time/timer.c b/lunaix-os/kernel/time/timer.c index 8f368df..b9d98af 100644 --- a/lunaix-os/kernel/time/timer.c +++ b/lunaix-os/kernel/time/timer.c @@ -9,7 +9,6 @@ * @copyright Copyright (c) 2022 * */ -#include #include #include @@ -17,6 +16,7 @@ #include #include #include +#include #include @@ -54,7 +54,7 @@ timer_init() timer_ctx->base_frequency = hwtimer_base_frequency(); - sched_ticks = SYS_TIMER_FREQUENCY_HZ / 1000 * SCHED_TIME_SLICE; + sched_ticks = (SYS_TIMER_FREQUENCY_HZ * SCHED_TIME_SLICE) / 1000; sched_ticks_counter = 0; } @@ -123,6 +123,7 @@ timer_update() if (sched_ticks_counter >= sched_ticks) { sched_ticks_counter = 0; + thread_stats_update_entering(false); schedule(); } }