25 TimeService* TimeService::_instance = 0;
66 : offset(0), use_clock(true)
79 if ( yes_no == use_clock )
83 if ( use_clock ==
true )
109 if ( relativeTime == 0 )
114 return (
getTicks() - relativeTime );
120 return (
getTicks() - relativeTime );
159 if ( relativeTime == 0 )
164 return (
getNSecs() - relativeTime );
virtual ~TimeService()
Destructor.
const double InfiniteSeconds
The TimeService is used for system-wide time keeping and conversions.
const TICK_TIME InfiniteTicks
static nsecs ticks2nsecs(const ticks t)
Convert an amount of ticks to nano seconds.
nsecs getNSecs() const
Get current nsecs of the System clock.
Seconds nsecs_to_Seconds(const nsecs ns)
NANO_TIME rtos_get_time_ns(void)
Get "system" time in nanoseconds.
const NANO_TIME InfiniteNSecs
long long ticks
The type for the systems clock tick.
static bool Release()
Releases the TimeService Reference counting might aid in making this call safe.
Seconds secondsSince(ticks relativeTime) const
Get Seconds passed since a certain moment.
ticks ticksChange(ticks delta)
Change the time with delta ticks.
static const ticks InfiniteTicks
The largest number representable in ticks.
ticks getTicks(ticks &relativeTime) const
Get clicks passed since a certain moment.
static TimeService * Instance()
Seconds getSeconds(ticks &relativeTime) const
Get the time in seconds passed since a certain moment.
bool systemClockEnabled() const
Check if the system clock is being read.
static const nsecs InfiniteNSecs
The largest number representable in nsecs.
TimeService()
Constructor.
static ticks nsecs2ticks(const nsecs m)
Convert an amount of nano seconds to System ticks.
static const Seconds InfiniteSeconds
The largest number representable in Seconds.
void enableSystemClock(bool yes_no)
Enables or disables reading the system clock.
ticks ticksSince(ticks relativeTime) const
Get clicks passed since a certain moment.
TICK_TIME rtos_get_time_ticks(void)
Get "system" time in ticks FIXME see https://proj.fmtc.be/orocos-bugzilla/show_bug.cgi?id=60
double Seconds
The type used to store SI unit time keeping.
NANO_TIME ticks2nano(TICK_TIME count)
Time conversions from system ticks to nano seconds.
nsecs Seconds_to_nsecs(const Seconds s)
TICK_TIME nano2ticks(NANO_TIME nano)
Time conversions from nano seconds to system ticks.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Seconds secondsChange(Seconds delta)
Change the time with delta seconds.
long long nsecs
An integer representation of nanoseconds.
ticks getTicks() const
Get current tick of the System clock.