XnFPSCalculator.h File Reference
`#include <XnPlatform.h>`
`#include <XnStatus.h>`

Go to the source code of this file.

## Typedefs

typedef struct XnFPSDataImpl * | XnFPSData

## Functions

XN_C_API XnStatus XN_C_DECL | xnFPSInit (XnFPSData *pFPS, XnUInt32 nSamplesCount)
XN_C_API XnStatus XN_C_DECL | xnFPSMarkFrame (XnFPSData *pFPS, XnUInt64 nNow=0)
XN_C_API XnDouble XN_C_DECL | xnFPSCalc (XnFPSData *pFPS, XnUInt32 nAverageOver=3000, XnUInt64 nNow=0)
XN_C_API XnStatus XN_C_DECL | xnFPSFree (XnFPSData *pFPS)

## Typedef Documentation

## XnFPSData

typedef struct XnFPSDataImpl* XnFPSData

## Function Documentation

## xnFPSCalc()

XN_C_API XnDouble XN_C_DECL xnFPSCalc | ( | XnFPSData * | pFPS,
|  | XnUInt32 | nAverageOver = 3000,
|  | XnUInt64 | nNow = 0 )

This function calculates the average FPS over the last frames.

Parameters

  pFPS | [in] A pointer to an XnFPSData struct.
  nAverageOver | [in] The number of milliseconds to average over.
  nNow | [in] Optional. Current time. When not provided, function will take it itself.

## xnFPSFree()

XN_C_API XnStatus XN_C_DECL xnFPSFree | ( | XnFPSData * | pFPS | ) |

This function frees the FPS calculator.

Parameters

  pFPS | [in] A pointer to an XnFPSData struct.

## xnFPSInit()

XN_C_API XnStatus XN_C_DECL xnFPSInit | ( | XnFPSData * | pFPS,
|  | XnUInt32 | nSamplesCount )

This function initializes the FPS calculator.

Parameters

  pFPS | [in] A pointer to an XnFPSData struct.
  nSamplesCount | [in] The number of last frames to be kept.

## xnFPSMarkFrame()

XN_C_API XnStatus XN_C_DECL xnFPSMarkFrame | ( | XnFPSData * | pFPS,
|  | XnUInt64 | nNow = 0 )

This function marks that another frame was processed.

Parameters

  pFPS | [in] A pointer to an XnFPSData struct.
  nNow | [in] Optional. Current time. When not provided, function will take it itself.