Helper class for calculating the frame rate.
More...
#include <kanzi/core.ui/util/frame_time_queue.hpp>
|
static const size_t | MeasurementBufferSize |
| The maximum size of the measurement window. Oldest frame duration samples that don't fit to the buffer are not included in the reported FPS. More...
|
|
static const chrono::milliseconds | MeasurementWindowWidth |
| The maximum duration of the measurement window. Frame duration samples that are older than this are not included in the reported FPS. More...
|
|
Helper class for calculating the frame rate.
Keeps track of the durations of frames over a short measurement window and calculates the average FPS.
kanzi::FrameTimeQueue::FrameTimeQueue |
( |
| ) |
|
|
explicit |
void kanzi::FrameTimeQueue::update |
( |
chrono::nanoseconds |
frameDuration | ) |
|
Updates the frame time queue with a new frame duration.
- Parameters
-
frameDuration | Duration of the new frame in nanoseconds. |
Returns the current FPS.
- Returns
- Current frame rate in frames per second.
const chrono::milliseconds kanzi::FrameTimeQueue::MeasurementWindowWidth |
|
static |
The maximum duration of the measurement window. Frame duration samples that are older than this are not included in the reported FPS.
const size_t kanzi::FrameTimeQueue::MeasurementBufferSize |
|
static |
The maximum size of the measurement window. Oldest frame duration samples that don't fit to the buffer are not included in the reported FPS.
size_t kanzi::FrameTimeQueue::m_firstFrame |
|
protected |
Frame time queue front index.
size_t kanzi::FrameTimeQueue::m_frameCount |
|
protected |
chrono::nanoseconds kanzi::FrameTimeQueue::m_totalTime |
|
protected |
Frame time queue content sum cache in nanoseconds.
float kanzi::FrameTimeQueue::m_fps |
|
protected |
The documentation for this class was generated from the following file: