![]() |
Visual Servoing Platform
version 3.2.0
|
Functions | |
VISP_EXPORT std::string | getDateTime (const std::string &format="%Y/%m/%d %H:%M:%S") |
VISP_EXPORT double | getMinTimeForUsleepCall () |
VISP_EXPORT double | measureTimeSecond () |
VISP_EXPORT double | measureTimeMs () |
VISP_EXPORT double | measureTimeMicros () |
VISP_EXPORT void | sleepMs (double t) |
VISP_EXPORT int | wait (double t0, double t) |
VISP_EXPORT void | wait (double t) |
Time management and measurement.
The example below shows how to synchronize a loop to a given framerate.
VISP_EXPORT std::string vpTime::getDateTime | ( | const std::string & | format | ) |
Return a string containing date and time.
[in] | format | : The string format supported by strftime() function that represents the time. The default format is the following "%Y/%m/%d %H:%M:%S" . This string contains any combination of special format specifiers given in the next table:
|
The following example shows how to use this function:
It produces the following output:
Definition at line 344 of file vpTime.cpp.
VISP_EXPORT double vpTime::getMinTimeForUsleepCall | ( | ) |
Definition at line 79 of file vpTime.cpp.
Referenced by vpSimulatorAfma6::updateArticularPosition().
VISP_EXPORT double vpTime::measureTimeMicros | ( | ) |
Return the time in microseconds since January 1st 1970.
Definition at line 114 of file vpTime.cpp.
vpTime::measureTimeMs | ( | ) |
Return the time in milliseconds since January 1st 1970.
Definition at line 87 of file vpTime.cpp.
Referenced by QPlot::plot(), vpSimulatorAfma6::setPosition(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorAfma6::vpSimulatorAfma6().
VISP_EXPORT double vpTime::measureTimeSecond | ( | ) |
Return the measured time in seconds since January 1st 1970.
Definition at line 249 of file vpTime.cpp.
Referenced by vpSimulatorAfma6::getPosition(), and vpSimulatorAfma6::getVelocity().
VISP_EXPORT void vpTime::sleepMs | ( | double | t | ) |
Sleep t miliseconds from now.
t | : Time to sleep in ms. |
Definition at line 257 of file vpTime.cpp.
VISP_EXPORT void vpTime::wait | ( | double | t | ) |
Wait t miliseconds from now.
The waiting is done by a call to usleep() if the time to wait is greater than vpTime::minTimeForUsleepCall.
t | : Time to wait in ms. |
Definition at line 201 of file vpTime.cpp.
VISP_EXPORT int vpTime::wait | ( | double | t0, |
double | t | ||
) |
Wait t miliseconds after t0 (in ms).
The waiting is done by a call to usleep() if the time to wait is greater than vpTime::minTimeForUsleepCall.
t0 | : reference time (in ms) |
t | : time to wait (in ms) |
Definition at line 149 of file vpTime.cpp.
Referenced by vpRobotWireFrameSimulator::getInternalView(), vpSimulatorAfma6::init(), vpSimulator::mainLoop(), vpSimulatorAfma6::setPosition(), and vpSimulatorAfma6::updateArticularPosition().