(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Stopwatch

Description: Devices to record the passing of time.

Keywords: ecl stopwatch

Tutorial Level: INTERMEDIATE

Next Tutorial: Benchmarking

StopWatch

This is a fairly intuitive class and uses the TimeStamp class under the hood for recording times.

Note that the stopwatch starts automatically, just use restart() if you wish to reset and start again.

   1 StopWatch stopwatch;
   2 TimeStamp time;
   3 time = stopwatch.split()
   4 cout << time << endl;
   5 time = stopwatch.elapsed()
   6 cout << time << endl;
   7 stopwatch.restart();

Wiki: ecl_time/Tutorials/Stopwatch (last edited 2012-01-31 15:17:27 by DanielStonier)