Go to the documentation of this file.
33 #define USECS_PER_SEC 1000000
34 #define NANOSECS_PER_SEC 1000000000
50 return IceUtil::Time::now();
78 if (duration.toMicroSeconds() <= 0)
90 USleep(duration.toMicroSeconds());
96 Sleep(IceUtil::Time::milliSeconds(durationMS));
158 return nanosleep(&ts,
nullptr);
164 return time.toString(
"%Y-%m-%d");
169 return time.toString(
"%H-%M-%S");
174 return time.toString(
"%Y-%m-%d_%H-%M-%S");
static std::string toStringTime(const IceUtil::Time &time)
Return a time string like "15-30-05" (H-M-S).
static std::string toStringDate(const IceUtil::Time &time)
Return a date string like "2020-01-31" (Y-M-D).
static std::string toStringDateTime(const IceUtil::Time &time)
Return a date & time string like "2020-01-31_15-30-05" (Y-M-D_H-M-S).
static void MSSleep(int durationMS)
lock the calling thread for a given duration (like usleep(...) but using Timeserver time)
static int NanoSleep(long usec)
Nanosleep convenience function.
CallbackWaitLock is used to block a thread and unblock it from another thread via callback.
static LocalTimeServerPtr GetTimeServer()
IceInternal::Handle< LocalTimeServer > LocalTimeServerPtr
void wait()
wait blocks the calling thread until CallbackWaitLock::call() is called.
static LocalTimeServerPtr timeServerPtr
pointer to the applications LocalTimeServer if NULL, system time is used
static int USleep(long usec)
like timed_wait on boost condition_variables, but with timeserver support
static bool HasTimeServer()
check if we have been initialized with a Timeserver
Used by CallbackWaitLock.
static void Sleep(IceUtil::Time duration)
lock the calling thread for a given duration (like usleep(...) but using Timeserver time)
armarx::core::time::DateTime Time
static void WaitForNextTick()
block until the next tick of the timeserver.
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
TimeMode
Time mode to be used.
static IceUtil::Time GetTimeSince(IceUtil::Time referenceTime, TimeMode timeMode=TimeMode::VirtualTime)
Get the difference between the current time and a reference time.
static void SetTimeServer(LocalTimeServerPtr ts)
This file offers overloads of toIce() and fromIce() functions for STL container types.