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

Function get_current_time

components/libc/posix/io/timerfd/timerfd.c:275–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275static int get_current_time(struct rt_timerfd *tfd, struct timespec *time)
276{
277 int ret = 0;
278 struct timespec *cur_time = RT_NULL;
279
280 if (time == RT_NULL)
281 {
282 cur_time = &tfd->pre_time;
283 }
284 else
285 {
286 cur_time = time;
287 }
288
289 if (tfd->clockid >= 0)
290 {
291 ret = clock_gettime(tfd->clockid, cur_time);
292 }
293 else
294 {
295 ret = clock_gettime(CLOCK_MONOTONIC, cur_time);
296 }
297
298 return ret;
299}
300
301static void timerfd_timeout(void *parameter)
302{

Callers 3

timerfd_timeoutFunction · 0.85
timerfd_do_settimeFunction · 0.85
timerfd_do_gettimeFunction · 0.85

Calls 1

clock_gettimeFunction · 0.85

Tested by

no test coverage detected