Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 897994e3 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by John Stultz
Browse files

timekeeping: Provide ktime_get[*]_ns() helpers



A lot of code converts either timespecs or ktime_t to
nanoseconds. Provide helper functions.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent dcaab54e
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -145,6 +145,21 @@ static inline ktime_t ktime_mono_to_real(ktime_t mono)
	return ktime_mono_to_any(mono, TK_OFFS_REAL);
}

static inline u64 ktime_get_ns(void)
{
	return ktime_to_ns(ktime_get());
}

static inline u64 ktime_get_real_ns(void)
{
	return ktime_to_ns(ktime_get_real());
}

static inline u64 ktime_get_boot_ns(void)
{
	return ktime_to_ns(ktime_get_boottime());
}

/*
 * RTC specific
 */