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

Function rt_ktime_boottime_get_s

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

Source from the content-addressed store, hash-verified

25}
26
27rt_weak rt_err_t rt_ktime_boottime_get_s(time_t *t)
28{
29 RT_ASSERT(t != RT_NULL);
30
31 rt_uint64_t ns = (rt_ktime_cputimer_getcnt() * rt_ktime_cputimer_getres()) / RT_KTIME_RESMUL;
32
33 *t = ns / (1000ULL * 1000 * 1000);
34
35 return RT_EOK;
36}
37
38rt_weak rt_err_t rt_ktime_boottime_get_ns(struct timespec *ts)
39{

Callers

nothing calls this directly

Calls 2

rt_ktime_cputimer_getcntFunction · 0.70
rt_ktime_cputimer_getresFunction · 0.50

Tested by

no test coverage detected