18 #ifndef IGNITION_MATH_STOPWATCH_HH_ 19 #define IGNITION_MATH_STOPWATCH_HH_ 23 #include <ignition/math/Export.hh> 24 #include <ignition/math/config.hh> 34 inline namespace IGNITION_MATH_VERSION_NAMESPACE {
37 class StopwatchPrivate;
81 public:
bool Start(
const bool _reset =
false);
87 public: clock::time_point StartTime()
const;
98 public: clock::time_point StopTime()
const;
102 public:
bool Running()
const;
106 public:
void Reset();
113 public: clock::duration ElapsedRunTime()
const;
120 public: clock::duration ElapsedStopTime()
const;
125 public:
bool operator==(
const Stopwatch &_watch)
const;
130 public:
bool operator!=(
const Stopwatch &_watch)
const;
145 #pragma warning(push) 146 #pragma warning(disable: 4251) std::chrono::steady_clock clock
Definition: DiffDriveOdometry.hh:31
The Stopwatch keeps track of time spent in the run state, accessed through ElapsedRunTime(), and time spent in the stop state, accessed through ElapsedStopTime(). Elapsed run time starts accumulating after the first call to Start(). Elapsed stop time starts accumulation after Start() has been called followed by Stop(). The stopwatch can be reset with the Reset() function.
Definition: Stopwatch.hh:61