MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_ktime_boottime_get_ns

Function rt_ktime_boottime_get_ns

components/drivers/ktime/src/boottime.c:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38rt_weak rt_err_t rt_ktime_boottime_get_ns(struct timespec *ts)
39{
40 RT_ASSERT(ts != RT_NULL);
41
42 rt_uint64_t ns = (rt_ktime_cputimer_getcnt() * rt_ktime_cputimer_getres()) / RT_KTIME_RESMUL;
43
44 ts->tv_sec = ns / (1000ULL * 1000 * 1000);
45 ts->tv_nsec = ns % (1000ULL * 1000 * 1000);
46
47 return RT_EOK;
48}

Callers 8

rt_vdso_update_glob_timeFunction · 0.85
rt_vdso_update_glob_timeFunction · 0.85
soft_rtc_controlFunction · 0.85
rt_pic_handle_isrFunction · 0.85
nanosleepFunction · 0.85
clock_gettimeFunction · 0.85
clock_nanosleepFunction · 0.85
timer_settimeFunction · 0.85

Calls 2

rt_ktime_cputimer_getcntFunction · 0.70
rt_ktime_cputimer_getresFunction · 0.50

Tested by

no test coverage detected