Functions | |
void | delay (double seconds) |
Wait for a certain number of seconds. More... | |
double | now () |
Return the current time in seconds, relative to an arbitrary starting point. More... | |
void | yield () |
The calling thread releases its remaining quantum upon calling this function. More... | |
void | useSystemClock () |
Configure YARP to use system time (this is the default). More... | |
void | useNetworkClock (const std::string &clock, const std::string &localPortName="") |
Configure YARP to read time from a specified topic. More... | |
void | useCustomClock (Clock *clock) |
Configure YARP clients to use a custom clock source provided by the user. More... | |
bool | isClockInitialized () |
Check if YARP clock is initialized. More... | |
bool | isSystemClock () |
Check if YARP is providing system time. More... | |
bool | isNetworkClock () |
Check if YARP is providing network time. More... | |
bool | isCustomClock () |
Check if YARP is using a user-defined custom time. More... | |
yarpClockType | getClockType () |
std::string | clockTypeToString (yarpClockType type) |
Converts clock type enum into string. More... | |
bool | isValid () |
Check if time is valid (non-zero). More... | |
void | turboBoost () |
For OS where it makes sense sets the scheduler to be called more often. More... | |
std::string yarp::os::Time::clockTypeToString | ( | yarpClockType | type | ) |
void yarp::os::Time::delay | ( | double | seconds | ) |
Wait for a certain number of seconds.
This may be fractional.
seconds | the duration of the delay, in seconds |
yarpClockType yarp::os::Time::getClockType | ( | ) |
bool yarp::os::Time::isClockInitialized | ( | ) |
bool yarp::os::Time::isCustomClock | ( | ) |
bool yarp::os::Time::isNetworkClock | ( | ) |
bool yarp::os::Time::isSystemClock | ( | ) |
bool yarp::os::Time::isValid | ( | ) |
double yarp::os::Time::now | ( | ) |
Return the current time in seconds, relative to an arbitrary starting point.
void yarp::os::Time::turboBoost | ( | ) |
For OS where it makes sense sets the scheduler to be called more often.
This sets the scheduler to be run to the maximum possible rate based on the capability of the hardware. Specifically, on Microsoft Windows, high resolution scheduling is used.
void yarp::os::Time::useCustomClock | ( | Clock * | clock | ) |
Configure YARP clients to use a custom clock source provided by the user.
The Clock source must implement the yarp::os::Clock interface. This function check clock->isValid() to verify the source is working properly.
Possible causes of failure are: clock pointer invalid or isValid() false.
Throws assert in case of failure
void yarp::os::Time::useNetworkClock | ( | const std::string & | clock, |
const std::string & | localPortName = "" |
||
) |
Configure YARP to read time from a specified topic.
The same effect can also be achieved using the YARP_CLOCK environment variable. Topic should provide two integers, time in seconds followed by residual in nanoseconds. If yarp is configured according to Using YARP with ROS, then ROS /clock topic will work.
return true on success, false on failure. Possible causes of failure are invalid port name or address conflict.
Throws assert in case of failure
void yarp::os::Time::useSystemClock | ( | ) |