26 #ifdef _IC_BUILDER_OPENSPLICEDDS_ 27 # include "icl_core/iTimeSpan.h" 42 #ifdef _IC_BUILDER_OPENSPLICEDDS_ 44 :
TimeBase(time_span.sec, time_span.nsec)
47 TimeSpan& TimeSpan::operator = (
const iTimeSpan& time_span)
50 nsecs = time_span.nsec;
54 TimeSpan::operator iTimeSpan ()
81 secs = usec / 1000000;
179 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 196 int64_t TimeSpan::TsSec()
const 201 int32_t TimeSpan::TsNSec()
const 206 int32_t TimeSpan::TsUSec()
const 211 int64_t TimeSpan::ToMSec()
const 216 int64_t TimeSpan::ToUSec()
const 221 int64_t TimeSpan::ToNSec()
const 236 calc_secs = -calc_secs;
238 if (calc_secs > 3600)
240 stream << calc_secs / 3600 <<
"h";
241 calc_secs = calc_secs % 3600;
245 stream << calc_secs / 60 <<
"m";
246 calc_secs=calc_secs % 60;
250 stream << calc_secs <<
"s";
253 if (calc_nsec / 1000000 * 1000000 == calc_nsec)
255 stream << calc_nsec / 1000000 <<
"ms";
257 else if (calc_nsec / 1000 * 1000 == calc_nsec)
259 stream << calc_nsec <<
"us";
263 stream << calc_nsec <<
"ns";
static TimeSpan createFromUSec(int64_t usec)
Create a time span with usec microseconds.
bool operator>(const TimeBase &other) const
static TimeSpan createFromMSec(int64_t msec)
Create a time span with msec milliseconds.
std::ostream & operator<<(std::ostream &os, StampedBase const &stamped)
bool operator<(const TimeSpan &other) const
TimeBase(int64_t secs=0, int32_t nsecs=0)
static const TimeSpan cZERO
TimeSpan(int64_t sec=0, int32_t nsec=0)
bool operator==(const TimeSpan &other) const
int64_t toMSec() const
May result in an overflow if seconds are too large.
bool operator!=(const TimeBase &other) const
bool operator!=(const TimeSpan &other) const
bool operator<(const TimeBase &other) const
bool operator>=(const TimeSpan &other) const
TimeSpan & fromUSec(int64_t usec)
Set the time span to usec microseconds.
bool operator>=(const TimeBase &other) const
TimeSpan & operator-=(const TimeSpan &span)
Substracts a TimeSpan.
TimeSpan & fromMSec(int64_t msec)
Set the time span to msec milliseconds.
TimeSpan & operator+=(const TimeSpan &span)
Adds a TimeSpan.
Repesents absolute times.
bool operator>(const TimeSpan &other) const
bool operator<=(const TimeSpan &other) const
bool operator==(const TimeBase &other) const
int64_t toUSec() const
May result in an overflow if seconds are too large.
static TimeSpan createFromSec(int64_t sec)
Create a time span with sec seconds.
bool operator<=(const TimeBase &other) const
TimeSpan & fromSec(int64_t sec)
Set the time span to sec seconds.