mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
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:
committed by
GUIDINGLI
parent
65bc3db624
commit
89dbed25a0
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user