NvFramerateCounter Class Reference
Simple frame rate timer and reporter. More...
#include <NvFramerateCounter.h>
Public Member Functions | |
NvFramerateCounter (NvStopWatchFactory *factory) | |
Constructor. | |
~NvFramerateCounter () | |
Destructor. | |
bool | nextFrame () |
Frame delimiter. | |
void | reset () |
Reset. | |
float | getMeanFramerate () |
Mean frame rate. | |
void | setReportFrames (int32_t frames) |
Set the report rate in frames. | |
int32_t | getReportFrames () |
Get the report rate in frames. | |
void | setMaxReportRate (float secs) |
Set the report rate in seconds. | |
float | getReportRate () |
Set the report rate in seconds. |
Detailed Description
Simple frame rate timer and reporter.Constructor & Destructor Documentation
NvFramerateCounter::NvFramerateCounter | ( | NvStopWatchFactory * | factory | ) |
Constructor.
- Parameters:
-
[in] app the application object to be used to create the required stopwatch
Member Function Documentation
float NvFramerateCounter::getMeanFramerate | ( | ) | [inline] |
Mean frame rate.
Mean frame rate since last report (the last time nextFrame returned "true")
- Returns:
- the frame rate in frames per second
int32_t NvFramerateCounter::getReportFrames | ( | ) | [inline] |
Get the report rate in frames.
- Returns:
- the minimum number of frames that must elapse between each mean frame rate update (i.e. between calls to nextFrame that return true)
float NvFramerateCounter::getReportRate | ( | ) | [inline] |
Set the report rate in seconds.
- Returns:
- the minimum number of seconds of wall-clock time that must elapse between each mean frame rate update (i.e. between calls to nextFrame that return true)
bool NvFramerateCounter::nextFrame | ( | ) |
Frame delimiter.
Call at the end of each frame to mark the end of a frame.
- Returns:
- true if the frame rate stats have been updated by this call and should be printed/updated to the user as appropriate
void NvFramerateCounter::reset | ( | ) |
Reset.
Restarts the counters - should be called when the app has come back after being paused, etc. Avoids incorrect stats generated by an extremely "long" frame (which was actually the app sleeping)
void NvFramerateCounter::setMaxReportRate | ( | float | secs | ) | [inline] |
Set the report rate in seconds.
- Parameters:
-
[in] secs the minimum number of seconds of wall-clock time that must elapse between each mean frame rate update (i.e. between calls to nextFrame that return true)
void NvFramerateCounter::setReportFrames | ( | int32_t | frames | ) | [inline] |
Set the report rate in frames.
- Parameters:
-
[in] frames the minimum number of frames that must elapse between each mean frame rate update (i.e. between calls to nextFrame that return true)
The documentation for this class was generated from the following file: