Skip to content

raisim::StopWatch ​

class · #include <raisim/StopWatch.hpp>

Wall-clock timer based on std::chrono::steady_clock. Supports one default timer and any number of named timers.

Public member functions ​

start ​

cpp
void start()

Start the default stopwatch timer.

cpp
void start(std::string name)

Start a named timer. Starting an existing name adds another entry; measure() reads the oldest one.

Parameters

ParameterDescription
name (in)Timer identifier.

measure ​

cpp
double measure()

Measure elapsed time since start() was called.

Returns elapsed time in seconds

cpp
double measure(std::string name, bool reset)

Measure elapsed time for a named timer.

Parameters

ParameterDescription
name (in)Timer identifier.
reset (in)True to remove the timer after reading.

Returns elapsed time in seconds, or a large value if the timer does not exist

RaiSim — physics for robotics and AI.