Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#71 yarp::os::Time::now()

open
nobody
General (20)
5
2010-05-17
2010-05-17
Anonymous
No

If I run this code:

double dBegin = yarp::os::Time::now();
yarp::os::Time::delay( 10.0 );
double dEnd = yarp::os::Time::now();
double diff = dEnd - dBegin;

The result is computer dependent. On my laptops the result is very different, and is not near 10.0.
Could you tell me why? The problem remains on the yarp::os::Time::now() function.

Discussion

  • If everything were working correctly, I would expect diff to be a little bit over 10 seconds due to process switching delays. What do you actually get? What operating system are you using? You could try running the yarp regression tests ("make test") to make sure your build is sane.