1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #ifndef _FRAMERATECOUNTER_H_
- #define _FRAMERATECOUNTER_H_
- #include <string>
- #include <core/basics/Timer.h>
- namespace NICE {
- class FrameRateCounter {
- public:
-
- FrameRateCounter(unsigned int lookBack = 30);
- ~FrameRateCounter();
-
-
- void reset();
-
-
- void newFrame();
-
-
- inline double getFrameRate() const {
- return m_frameRate;
- }
-
-
- inline int getCounter() const {
- return m_counter;
- }
- private:
- Timer m_timer;
- unsigned int m_lookBack;
- unsigned int m_counter;
- double m_frameRate;
- };
- }
- #endif
|