sched/hrtimer: Replace hrtimer_gettime with clock_systime_nsec.

This commit move the hrtimer_gettime to clock_systime_nsec to improve
the code reusability.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
ouyangxiangzhen
2026-01-07 20:56:55 +08:00
committed by GUIDINGLI
parent 65bc3db624
commit 89dbed25a0
4 changed files with 24 additions and 26 deletions
+22
View File
@@ -733,6 +733,28 @@ clock_t clock_systime_ticks(void);
void clock_systime_timespec(FAR struct timespec *ts);
/****************************************************************************
* Name: clock_systime_nsec
*
* Description:
* Return the current value of the system timer counter as
* uint64_t nanoseconds.
*
* Input Parameters:
* ts - Location to return the time
*
* Returned Value:
* The current system time in nanoseconds.
*
****************************************************************************/
static inline_function uint64_t clock_systime_nsec(void)
{
struct timespec ts;
clock_systime_timespec(&ts);
return clock_time2nsec(&ts);
}
/****************************************************************************
* Name: clock_cpuload
*