Game Project
Loading...
Searching...
No Matches
FPSTracker Class Reference

Keeps track of FPS statistics over time. Call update to add samples, and update stats to recalculate averages, highs, and lows. More...

#include <FPSTracker.h>

Public Member Functions

void Update (const sf::Time &delta_time)
 Adds an extra sample to the FPS history.
 
void UpdateStats (const sf::Time &delta_time)
 Updates the current stats: average, highs, lows.
 
const float & GetAverageFps () const
 Returns the last calculated average FPS.
 
const float & GetFrameTimeMs () const
 Returns the last calculated Frame Time in MS.
 
const float & GetHighsFps () const
 Returns the last calculated High FPS.
 
const float & GetLowsFps () const
 Returns the last calculated Low FPS.
 

Detailed Description

Keeps track of FPS statistics over time. Call update to add samples, and update stats to recalculate averages, highs, and lows.

Member Function Documentation

◆ GetAverageFps()

const float & FPSTracker::GetAverageFps ( ) const
inline

Returns the last calculated average FPS.

Returns
Current average FPS

◆ GetFrameTimeMs()

const float & FPSTracker::GetFrameTimeMs ( ) const
inline

Returns the last calculated Frame Time in MS.

Returns
Current frame time in ms

◆ GetHighsFps()

const float & FPSTracker::GetHighsFps ( ) const
inline

Returns the last calculated High FPS.

Returns
Current high in FPS history

◆ GetLowsFps()

const float & FPSTracker::GetLowsFps ( ) const
inline

Returns the last calculated Low FPS.

Returns
Current low in FPS history

◆ Update()

void FPSTracker::Update ( const sf::Time & delta_time)

Adds an extra sample to the FPS history.

Parameters
delta_time

The documentation for this class was generated from the following files: