12 #include "../../include/ecl/time_lite/functions_rt.hpp" 19 #if defined(ECL_HAS_RT_TIMERS) 27 TimeError epoch_time(TimeStructure &time) {
31 #ifdef ECL_HAS_CLOCK_MONOTONIC 32 int result = clock_gettime(CLOCK_MONOTONIC,&time);
34 int result = clock_gettime(CLOCK_REALTIME,&time);
37 case(0) : {
return TimeError(
NoError); }
45 TimeError realtime_epoch_time(TimeStructure &time) {
46 int result = clock_gettime(CLOCK_REALTIME,&time);
48 case(0) : {
return TimeError(
NoError); }
56 TimeError sleep_until(
const TimeStructure &time) {
58 #ifdef ECL_HAS_CLOCK_MONOTONIC 59 int result = clock_nanosleep(CLOCK_MONOTONIC,TIMER_ABSTIME,&time,NULL);
61 int result = clock_nanosleep(CLOCK_REALTIME,TIMER_ABSTIME,&time,NULL);
64 case(0) : {
return TimeError(
NoError); }
71 TimeError sleep(
const TimeStructure &time) {
72 int result = nanosleep(&time, NULL);
74 case(0) : {
return TimeError(
NoError); }