AV module

legacy::FPSCounter

Legacy frames-per-second counter.

FPSCounter

#include <icy/av/fpscounter.h>

Legacy frames-per-second counter.

Public Attributes

ReturnNameDescription
clock_tstart
clock_tend
int64_tframes
doubletotal
doublefps

start

clock_t start

end

clock_t end

frames

int64_t frames

total

double total

fps

double fps

Public Methods

ReturnNameDescription
FPSCounter inline
voidtick inlineBegin a new timing cycle (calls endFrame() first if already started).
voidreset inlineReset all counters to zero.
boolstarted inline#### Returns
voidstartFrame inlineRecord the frame start time.
doubleendFrame inlineRecord the frame end time and update the cumulative FPS average.

FPSCounter

inline

inline FPSCounter()

tick

inline

inline void tick()

Begin a new timing cycle (calls endFrame() first if already started).


reset

inline

inline void reset()

Reset all counters to zero.


started

inline

inline bool started()

Returns

True if startFrame() has been called and the timer is running.


startFrame

inline

inline void startFrame()

Record the frame start time.


endFrame

inline

inline double endFrame()

Record the frame end time and update the cumulative FPS average.

Returns

The updated FPS value.