Frame rate measurement counter with selectable averaging window. More...
#include <cvb/utilities/rate_counter.hpp>
Public Member Functions | |
RateCounter () | |
Constructor for a rate counter object for multi-CPU architectures with default averaging window size (25). More... | |
RateCounter (int windowSize) | |
Constructor for a rate counter object for multi-CPU architectures. More... | |
RateCounter (int windowSize, StopWatchMode mode) | |
Constructor for a rate counter object. More... | |
StopWatchMode | Mode () const noexcept |
The stop watch mode used internally. More... | |
int | WindowSize () const noexcept |
Gets the currently used averaging window size. More... | |
void | SetWindowSize (int windowSize) |
Sets the currently used averaging window size. More... | |
std::chrono::milliseconds | AverageTimeSpan () const noexcept |
Average time span between two steps or since the creation of the counter or the most recent reset. More... | |
double | Rate () const noexcept |
Returns the rate(1 / s) at which the steps occurred. More... | |
int | NumSteps () const noexcept |
Number of steps called since construction or since last reset. More... | |
void | Reset () noexcept |
Erase all measurements so far. More... | |
void | Step () noexcept |
Reading step (first reading step will not yield a measurement result, but define the starting point). More... | |
Static Public Member Functions | |
static std::unique_ptr< RateCounter > | Create () |
Creates a frame counter object for multi CPU with default averaging window (25). More... | |
static std::unique_ptr< RateCounter > | Create (int windowSize) |
Creates a frame counter object for multi CPU. More... | |
static std::unique_ptr< RateCounter > | Create (int windowSize, StopWatchMode mode) |
Creates a frame counter object. More... | |
Frame rate measurement counter with selectable averaging window.
|
inline |
Constructor for a rate counter object for multi-CPU architectures with default averaging window size (25).
Any | exception derived from std::exception including CvbException. |
|
inlineexplicit |
Constructor for a rate counter object for multi-CPU architectures.
[in] | windowSize | Averaging window (i.e. number of measurements over which to average). |
Any | exception derived from std::exception including CvbException. |
|
inline |
Constructor for a rate counter object.
[in] | windowSize | Averaging window (i.e. number of measurements over which to average). |
[in] | mode | Mode to use. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Average time span between two steps or since the creation of the counter or the most recent reset.
Does | not throw any exception. |
|
inlinestatic |
Creates a frame counter object for multi CPU with default averaging window (25).
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates a frame counter object for multi CPU.
[in] | windowSize | Averaging window (i.e. number of measurements to be averaged over). |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates a frame counter object.
[in] | windowSize | Averaging window (i.e. number of measurements over which to average). |
[in] | mode | Mode to use. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
The stop watch mode used internally.
Does | not throw any exception. |
|
inlinenoexcept |
Number of steps called since construction or since last reset.
Does | not throw any exception. |
|
inlinenoexcept |
Returns the rate(1 / s) at which the steps occurred.
Does | not throw any exception. |
|
inlinenoexcept |
Erase all measurements so far.
Does | not throw any exception. |
|
inline |
Sets the currently used averaging window size.
[in] | windowSize | between MinimumWindowSize and MaximumWindowSize. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Reading step (first reading step will not yield a measurement result, but define the starting point).
Does | not throw any exception. |
|
inlinenoexcept |
Gets the currently used averaging window size.
Does | not throw any exception. |