Calculate "frame-per-second" of something.
More...
#include <tools.h>
|
| FramesPerSecond () noexcept |
|
void | end_frame () |
| Call at the end of every frame.
|
|
float | fps () |
| Retrieve the current FPS value.
|
|
EGT_NODISCARD bool | ready () const |
| Is any calculation ready?
|
|
void | start () |
| Start/reset the counter.
|
|
|
float | m_fps {0.} |
| Calculated FPS.
|
|
uint64_t | m_frames {0} |
| Number of frames recorded since start time.
|
|
bool | m_ready {false} |
| Is m_fps valid and ready?
|
|
std::chrono::time_point< std::chrono::steady_clock > | m_start {} |
| Start time.
|
|
Calculate "frame-per-second" of something.
while (true)
{
std::cout << std::round(
fps.fps()) << std::endl;
}
Calculate "frame-per-second" of something.
Definition tools.h:64
void start()
Start/reset the counter.
Definition tools.h:75
float fps()
Retrieve the current FPS value.
Definition tools.h:106
◆ FramesPerSecond()
◆ end_frame()
Call at the end of every frame.
◆ fps()
Retrieve the current FPS value.
◆ ready()
EGT_NODISCARD bool ready |
( |
| ) |
const |
|
inline |
Is any calculation ready?
◆ start()
◆ m_fps
◆ m_frames
Number of frames recorded since start time.
◆ m_ready
Is m_fps valid and ready?
◆ m_start
std::chrono::time_point<std::chrono::steady_clock> m_start {} |
|
protected |