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.
|
|
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.
|
|
Helper class for calculating the frame rate.
Keeps track of the durations of frames over a short measurement window and calculates the average FPS.
◆ FrameTimeQueue()
kanzi::FrameTimeQueue::FrameTimeQueue |
( |
| ) |
|
|
explicit |
◆ update()
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. |
◆ getFPS()
Returns the current FPS.
- Returns
- Current frame rate in frames per second.
◆ MeasurementWindowWidth
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.
◆ MeasurementBufferSize
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.
◆ m_frames
◆ m_firstFrame
size_t kanzi::FrameTimeQueue::m_firstFrame |
|
protected |
Frame time queue front index.
◆ m_frameCount
size_t kanzi::FrameTimeQueue::m_frameCount |
|
protected |
◆ m_totalTime
chrono::nanoseconds kanzi::FrameTimeQueue::m_totalTime |
|
protected |
Frame time queue content sum cache in nanoseconds.
◆ m_fps
float kanzi::FrameTimeQueue::m_fps |
|
protected |
The documentation for this class was generated from the following file: