From 8168d385ecc7ec1ae618996dffc45bb861502ebc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 11 Dec 2025 11:06:56 +0100 Subject: feat: Timer.h: Turn `rtl_*seconds` helpers into `constexpr` functions. Signed-off-by: Amlal El Mahrouss --- src/kernel/KernelKit/Timer.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/kernel/KernelKit') diff --git a/src/kernel/KernelKit/Timer.h b/src/kernel/KernelKit/Timer.h index c55ca3a1..c9c23df8 100644 --- a/src/kernel/KernelKit/Timer.h +++ b/src/kernel/KernelKit/Timer.h @@ -61,16 +61,13 @@ class HardwareTimer final : public ITimer { Int64 fWaitFor{0}; }; -inline UInt64 rtl_microseconds(UInt64 time) { +inline constexpr UInt64 rtl_microseconds(UInt64 time) { if (time < 1) return 0; - - // TODO: nanoseconds maybe? return time / kTimeUnit; } -inline UInt64 rtl_milliseconds(UInt64 time) { +inline constexpr UInt64 rtl_milliseconds(UInt64 time) { if (time < 1) return 0; - return time; } } // namespace Kernel -- cgit v1.2.3