Visual Servoing Platform  version 3.6.1 under development (2024-12-06)
vpTime Namespace Reference

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)
 

Detailed Description

Time management and measurement.

The example below shows how to synchronize a loop to a given framerate.

#include <visp3/core/vpTime.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
double t;
for ( ; ; ) {
...
vpTime::wait(t, 40); // Loop time is set to 40 ms, ie 25 Hz
}
}
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeMs()

Function Documentation

◆ getDateTime()

◆ getMinTimeForUsleepCall()

VISP_EXPORT double vpTime::getMinTimeForUsleepCall ( )

◆ measureTimeMicros()

◆ measureTimeMs()

vpTime::measureTimeMs ( )

Return the time in milliseconds since January 1st 1970.

See also
measureTimeMicros(), measureTimeSecond()
Examples
AROgre.cpp, ClassUsingPclViewer.cpp, SickLDMRS-Acq.cpp, SickLDMRS-Process.cpp, displaySequence.cpp, grab1394CMU.cpp, grab1394Two.cpp, grabDirectShow.cpp, grabDirectShowMulti.cpp, grabDisk.cpp, grabRealSense2.cpp, grabRealSense2_T265.cpp, grabV4l2.cpp, grabV4l2MultiCpp11Thread.cpp, manServo4PointsDisplay.cpp, manServoMomentsSimple.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, mbot-apriltag-2D-half-vs.cpp, mbot-apriltag-ibvs.cpp, mbot-apriltag-pbvs.cpp, mbtGenericTrackingDepth.cpp, mbtGenericTrackingDepthOnly.cpp, movePioneer.cpp, quadprog.cpp, quadprog_eq.cpp, readRealSenseData.cpp, saveRealSenseData.cpp, sendMocapToPixhawk.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma6AprilTagIBVS.cpp, servoAfma6AprilTagPBVS.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6MegaposePBVS.cpp, servoBebop2.cpp, servoFlirPtuIBVS.cpp, servoFrankaIBVS.cpp, servoFrankaPBVS.cpp, servoMomentImage.cpp, servoMomentPolygon.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoUniversalRobotsIBVS.cpp, servoUniversalRobotsPBVS.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DCamVelocityKalman.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, sonarPioneerReader.cpp, templateTracker.cpp, testAutoThreshold.cpp, testColVector.cpp, testComedi.cpp, testConnectedComponents.cpp, testContours.cpp, testFeatureSegment.cpp, testFloodFill.cpp, testForceTorqueAti.cpp, testForceTorqueAtiNetFTSensor.cpp, testForceTorqueIitSensor.cpp, testGenericTracker.cpp, testGenericTrackerDepth.cpp, testHistogram.cpp, testImageDifference.cpp, testImageFilter.cpp, testImageGetValue.cpp, testImageNormalizedCorrelation.cpp, testImageTemplateMatching.cpp, testImgproc.cpp, testKeyPoint-6.cpp, testMatrix.cpp, testMatrixDeterminant.cpp, testMatrixInverse.cpp, testMatrixPseudoInverse.cpp, testMouseEvent.cpp, testOccipitalStructure_Core_images.cpp, testOccipitalStructure_Core_pcl.cpp, testPerformanceLUT.cpp, testPixhawkDroneKeyboard.cpp, testPixhawkRoverVelocityControl.cpp, testPolygon.cpp, testRealSense2_D435.cpp, testRealSense2_SR300.cpp, testRealSense2_T265_images.cpp, testRealSense2_T265_images_odometry.cpp, testRealSense2_T265_odometry.cpp, testRealSense2_T265_undistort.cpp, testRobotBebop2.cpp, testRobotFlirPtu.cpp, testRobotViper650-frames.cpp, testRobotViper850-frames.cpp, testSvd.cpp, testTime.cpp, testTukeyEstimator.cpp, testUndistortImage.cpp, trackDot.cpp, tutorial-apriltag-detector-live-T265-realsense.cpp, tutorial-apriltag-detector-live-rgbd-realsense.cpp, tutorial-apriltag-detector-live-rgbd-structure-core.cpp, tutorial-apriltag-detector-live.cpp, tutorial-apriltag-detector.cpp, tutorial-dnn-object-detection-live.cpp, tutorial-face-detector-live.cpp, tutorial-grabber-1394.cpp, tutorial-grabber-basler-pylon.cpp, tutorial-grabber-bebop2.cpp, tutorial-grabber-flycapture.cpp, tutorial-grabber-opencv.cpp, tutorial-grabber-realsense-T265.cpp, tutorial-grabber-realsense.cpp, tutorial-grabber-structure-core.cpp, tutorial-grabber-v4l2.cpp, tutorial-hsv-segmentation-pcl-viewer.cpp, tutorial-hsv-segmentation-pcl.cpp, tutorial-hsv-segmentation.cpp, tutorial-klt-tracker.cpp, tutorial-mb-generic-tracker-live.cpp, tutorial-mb-generic-tracker-read.cpp, tutorial-mb-generic-tracker-rgbd-realsense-json.cpp, tutorial-mb-generic-tracker-rgbd-realsense.cpp, tutorial-mb-generic-tracker-rgbd-structure-core.cpp, tutorial-mb-generic-tracker-rgbd.cpp, tutorial-mb-generic-tracker-save.cpp, tutorial-megapose-live-single-object-tracking.cpp, tutorial-panda3d-renderer.cpp, tutorial-pf-curve-fitting-all.cpp, tutorial-pf-curve-fitting-lms.cpp, tutorial-pf-curve-fitting-pf.cpp, tutorial-pf.cpp, tutorial-pose-from-points-live.cpp, tutorial-pose-from-points-realsense-T265.cpp, tutorial-template-tracker.cpp, tutorial-video-manipulation.cpp, and tutorial-video-reader.cpp.

Referenced by vpKeyPoint::computePose(), vpKeyPoint::detect(), vpKeyPoint::extract(), vpKeyPoint::match(), vpQbSoftHand::setPosition(), vpChrono::start(), vpChrono::stop(), ClassUsingPclViewer::threadedMode(), and vpForceTorqueAtiNetFTSensor::waitForNewData().

◆ measureTimeSecond()

◆ sleepMs()

◆ wait() [1/2]

VISP_EXPORT void vpTime::wait ( double  t)

◆ wait() [2/2]

VISP_EXPORT int vpTime::wait ( double  t0,
double  t 
)
Examples
AROgre.cpp, AROgreBasic.cpp, ClassUsingPclViewer.cpp, displaySequence.cpp, grab1394Two.cpp, grabDisk.cpp, keyboardControlBebop2.cpp, manServo4PointsDisplay.cpp, manServoMomentsSimple.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, mbtEdgeKltTracking.cpp, moveBiclops.cpp, movePioneer.cpp, perfGenericTracker.cpp, readRealSenseData.cpp, ringLight.cpp, sendMocapToPixhawk.cpp, servoBebop2.cpp, servoKinovaJacoCart.cpp, servoKinovaJacoJoint.cpp, servoMomentImage.cpp, servoMomentPolygon.cpp, servoPololuPtuPoint2DJointVelocity.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DCamVelocityKalman.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, sonarPioneerReader.cpp, testComedi.cpp, testFeatureSegment.cpp, testForceTorqueAti.cpp, testForceTorqueAtiNetFTSensor.cpp, testForceTorqueIitSensor.cpp, testFrankaCartForceTorque-2.cpp, testFrankaCartForceTorque.cpp, testFrankaCartVelocity-2.cpp, testFrankaCartVelocity-3.cpp, testFrankaCartVelocity.cpp, testFrankaGetPose.cpp, testFrankaJointTorque.cpp, testFrankaJointVelocity-2.cpp, testFrankaJointVelocity-3.cpp, testFrankaJointVelocity.cpp, testFrankaJointVelocityLimits.cpp, testMouseEvent.cpp, testPixhawkDroneKeyboard.cpp, testPixhawkDroneTakeoff.cpp, testPixhawkRoverVelocityControl.cpp, testRealSense2_SR300.cpp, testRobotBebop2.cpp, testSerialRead.cpp, testTime.cpp, testUniversalRobotsCartVelocity.cpp, testUniversalRobotsGetData.cpp, testUniversalRobotsJointVelocity.cpp, testVirtuoseAfma6.cpp, trackMeNurbs.cpp, tutorial-blob-auto-tracker.cpp, tutorial-circle-hough.cpp, tutorial-event-keyboard.cpp, tutorial-face-detector-live-threaded.cpp, tutorial-grabber-opencv-threaded.cpp, tutorial-grabber-structure-core.cpp, tutorial-grabber-v4l2-threaded.cpp, tutorial-ibvs-4pts-display.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-json.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter.cpp, tutorial-ibvs-4pts-wireframe-camera.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-klt-tracker-live-v4l2.cpp, tutorial-klt-tracker.cpp, tutorial-mb-generic-tracker-read.cpp, tutorial-megapose-live-single-object-tracking.cpp, tutorial-pf.cpp, tutorial-pioneer-robot.cpp, tutorial-pose-from-points-image.cpp, tutorial-pose-from-qrcode-image.cpp, tutorial-template-tracker.cpp, tutorial-ukf.cpp, tutorial-video-manipulation.cpp, and tutorial-video-reader.cpp.

Referenced by vpRobotViper850::biasForceTorqueSensor(), vpRobotViper650::biasForceTorqueSensor(), vpTemplateTrackerZone::initClick(), vpSimulator::initMainApplication(), vpPylonGrabberGigE::loadUserSet(), vpPylonGrabberUsb::loadUserSet(), vpSimulator::mainLoop(), vp1394TwoGrabber::resetBus(), vpPylonGrabberGigE::saveUserSet(), vpPylonGrabberUsb::saveUserSet(), vpFlyCaptureGrabber::setCameraPower(), vpQbSoftHand::setPosition(), vpRobotBiclops::setRobotState(), vpForceTorqueIitSensor::startStreaming(), ClassUsingPclViewer::threadedMode(), and vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().