30 #ifdef _SYSTEM_LXRT_33_ 31 # include <rtai_lxrt.h> 32 # include <rtai_posix.h> 85 while (((
secs >= 0) && (
nsecs >= 1000000000)) ||
86 ((
secs <= 0) && (
nsecs <= -1000000000)) ||
95 else if ((
secs <= 0) && (
nsecs <= -1000000000))
123 #ifdef _SYSTEM_LXRT_33_ 130 RTIME rtime_rtai_now = rt_get_time();
131 RTIME rtime_global_now = timespec2count(&global_now);
132 RTIME rtime_time = timespec2count(&time);
134 count2timespec(rtime_time + rtime_rtai_now - rtime_global_now, &time);
142 #ifdef _SYSTEM_LXRT_33_ 147 #ifdef _SYSTEM_DARWIN_ 148 mach_timespec_t TimeBase::machTimespec()
const 150 mach_timespec_t time;
151 time.tv_sec =
static_cast<unsigned int>(
secs);
152 time.tv_nsec =
static_cast<clock_res_t
>(
nsecs);
158 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 160 void TimeBase::NormalizeTime()
170 int64_t TimeBase::Hours()
const 175 int64_t TimeBase::Minutes()
const 180 int64_t TimeBase::Seconds()
const 185 int32_t TimeBase::MilliSeconds()
const 190 int32_t TimeBase::MicroSeconds()
const 195 int32_t TimeBase::NanoSeconds()
const 200 int64_t TimeBase::TbSec()
const 205 int32_t TimeBase::TbNSec()
const 210 struct timespec TimeBase::Timespec() const
215 struct timespec TimeBase::SystemTimespec() const
220 #ifdef _SYSTEM_DARWIN_ 224 mach_timespec_t TimeBase::MachTimespec()
const 226 return machTimespec();
236 return TimeBase(std::numeric_limits<int64_t>::max(), 999999999);
261 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 263 TimeBase TimeBase::MaxTime()
268 void TimeBase::FromTimespec(
const struct timespec& time)
bool operator>(const TimeBase &other) const
int32_t nanoSeconds() const
int32_t milliSeconds() const
int64_t tbSec() const
Returns the second part of this time.
int32_t tbNSec() const
Returns the nanosecond part of this time.
int64_t days() const
Use this function if you want to express the time in days.
TimeBase(int64_t secs=0, int32_t nsecs=0)
static TimeBase maxTime()
TimeBase & operator-=(const TimeBase &span)
Substracts a TimeSpan.
bool operator!=(const TimeBase &other) const
bool operator<(const TimeBase &other) const
bool operator>=(const TimeBase &other) const
struct timespec timespec() const
TimeBase & operator+=(const TimeBase &span)
Adds a TimeSpan.
Contains global LXRT functions.
int32_t microSeconds() const
Contains global functions for time manipulation, encapsulated into the icl_core::os namespace...
bool operator==(const TimeBase &other) const
void gettimeofday(struct timespec *time)
struct timespec systemTimespec() const
bool operator<=(const TimeBase &other) const
void fromTimespec(const struct timespec &time)