F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
/opt/jenkins/workspace/F_Prime_Infrastructure/fprime-website-publishing/fprime/Os/IntervalTimer.hpp

Os::IntervalTimer measures time intervals using start/stop functionality.The IntervalTimer class provides methods to capture the start and stop times of an interval and calculate the difference between these times. It is useful for measuring the duration of operations or events. Intervals can be returned in Fw::TimeInterval or as a microsecond U32.

Note
The caller must ensure that the start() method is called before the stop() method to get a relevant time interval.

IntervalTimer timer; timer.start(); // Perform some operations timer.stop(); Fw::TimeInterval interval = timer.getTimeInterval();

// ======================================================================
// \title Os/IntervalTimer.hpp
// \brief Definition for Os::IntervalTimer
// ======================================================================
#ifndef _IntervalTimer_hpp_
#define _IntervalTimer_hpp_
#include <FpConfig.hpp>
#include <Os/RawTime.hpp>
namespace Os {
class IntervalTimer {
public:
~IntervalTimer() = default;
void start();
void stop();
U32 getDiffUsec() const;
PRIVATE:
RawTime m_startTime;
RawTime m_stopTime;
}; // class IntervalTimer
} // namespace Os
#endif