diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-11 11:06:56 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-11 11:06:56 +0100 |
| commit | 8168d385ecc7ec1ae618996dffc45bb861502ebc (patch) | |
| tree | 6d17f2b7d47ea75ff5df45d0f4e221d560db1323 | |
| parent | e72855005c58cdcf30645f2c16774450d782c849 (diff) | |
feat: Timer.h: Turn `rtl_*seconds` helpers into `constexpr` functions.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | src/kernel/KernelKit/Timer.h | 7 |
1 files changed, 2 insertions, 5 deletions
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 |
