26 : mTimeWindow(timeWindow)
33 mFrameTime2 = mFrameTime1;
34 mFrameTime1 = std::chrono::steady_clock::now();
37 ++mFramesPerElapsedTime;
44 if (mElapsedTime >= mTimeWindow)
46 mFramesPerSecond = mFramesPerElapsedTime / mElapsedTime * 1000;
48 mFramesPerElapsedTime = 0;
57 mTimeWindow = timeWindow;
62 return mFramesPerSecond;
67 return std::chrono::duration<double>(mFrameTime1 - mFrameTime2).count() * 1000;
82 mFramesPerElapsedTime = 0;
84 mFrameTime1 = std::chrono::steady_clock::now();
85 mFrameTime2 = mFrameTime1;
FPSMeter(double timeWindow=1000)
void reset()
Reset all frame information.
void setTimeWindow(double timeWindow)
Time window setup.
double deltaTime() const
Time in milliseconds between last frames.
double totalTime() const
Total time.
uint64_t totalFrames() const
Total frames.
double framesPerSecond() const
Number of frames per second counted in the time window.
bool newFrame()
When you get a frame, call the function to count.
Namespace to encapsulate INDI client, drivers, and mediator classes.