Go to the documentation of this file.
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)
bool Stop()
Stop the stopwatch.
bool operator!=(const Stopwatch &_watch) const
Inequality operator.
Definition: AdditivelySeparableScalarField3.hh:27
bool Start(const bool _reset=false)
Start the stopwatch.
bool operator==(const Stopwatch &_watch) const
Equality operator.
clock::duration ElapsedRunTime() const
Get the amount of time that the stop watch has been running. This is the total amount of run time,...
void Reset()
Reset the stopwatch. This resets the start time, stop time, elapsed duration and elapsed stop duratio...
bool Running() const
Get whether the stopwatch is running.
The Stopwatch keeps track of time spent in the run state, accessed through ElapsedRunTime(),...
Definition: Stopwatch.hh:61
Stopwatch & operator=(const Stopwatch &_watch)
Copy assignment operator.
std::chrono::steady_clock clock
Definition: DiffDriveOdometry.hh:31
clock::duration ElapsedStopTime() const
Get the amount of time that the stop watch has been stopped. This is the total amount of stop time,...
virtual ~Stopwatch()
Destructor.
clock::time_point StopTime() const
Get the time when the stopwatch was last stopped.
clock::time_point StartTime() const
Get the time when the stopwatch was started.