|
|
The FPSCounter class provides methods for calculating the frames per second (FPS) count in periodic tasks. More...
#include <VisionX/tools/FPSCounter.h>
Public Member Functions | |
| void | assureFPS (float fFrameRate) |
| Synchronize to FPS. More... | |
| FPSCounter (int nDelayFrames=10) | |
| Constructs a new FPS counter. More... | |
| float | getFPS () |
| Get frames per second. More... | |
| float | getMaxCycleTimeMS () |
| Get maximum cycle time since start. More... | |
| float | getMeanCycleTimeMS () |
| Get mean cycle time over last 10 frames. More... | |
| float | getMinCycleTimeMS () |
| Get minimum cycle time since start. More... | |
| int | getUpdates () |
| Get number of updates. More... | |
| bool | getValid () |
| Get if calculated values are valid. More... | |
| void | recalculate () |
| recalculates the FPS statistics More... | |
| void | reset () |
| Resets the FPS counter to its initial state. More... | |
| void | update () |
| Updates the FPS counter. More... | |
The FPSCounter class provides methods for calculating the frames per second (FPS) count in periodic tasks.
Further synchronization to a given FPS is supported.
Definition at line 36 of file FPSCounter.h.
| FPSCounter | ( | int | nDelayFrames = 10 | ) |
Constructs a new FPS counter.
| nDelayFrames | number of frames to use for FPS calculation. The FPS calculation will be delayed by this amount of frames |
Definition at line 40 of file FPSCounter.cpp.
Here is the call graph for this function:| void assureFPS | ( | float | fFrameRate | ) |
Synchronize to FPS.
Using this method in a periodic task will synchronize the task to the specified FPS. Update is called internally, so do not call update at a different position.
| fFrameRate | frames per second to use for synchronization |
Definition at line 87 of file FPSCounter.cpp.
Here is the caller graph for this function:| float getFPS | ( | ) |
Get frames per second.
Definition at line 134 of file FPSCounter.cpp.
Here is the caller graph for this function:| float getMaxCycleTimeMS | ( | ) |
Get maximum cycle time since start.
Definition at line 174 of file FPSCounter.cpp.
Here is the caller graph for this function:| float getMeanCycleTimeMS | ( | ) |
Get mean cycle time over last 10 frames.
Definition at line 145 of file FPSCounter.cpp.
Here is the caller graph for this function:| float getMinCycleTimeMS | ( | ) |
Get minimum cycle time since start.
Definition at line 163 of file FPSCounter.cpp.
Here is the caller graph for this function:| int getUpdates | ( | ) |
Get number of updates.
Definition at line 128 of file FPSCounter.cpp.
| bool getValid | ( | ) |
Get if calculated values are valid.
Calculated values are valid if the minimum amount of delay frames has passed (m_nDelayFrames, see constructor)
Definition at line 122 of file FPSCounter.cpp.
| void recalculate | ( | ) |
recalculates the FPS statistics
Definition at line 76 of file FPSCounter.cpp.
| void reset | ( | ) |
Resets the FPS counter to its initial state.
Definition at line 51 of file FPSCounter.cpp.
Here is the caller graph for this function:| void update | ( | ) |
Updates the FPS counter.
Using this method in a periodic task will measure the time elapsed from one call to the next. Based on this time, the FPS is calculated.
Definition at line 63 of file FPSCounter.cpp.