MCPcopy Create free account
hub / github.com/Hopson97/HopsonCraft / update

Method update

Source/Util/Time_Check.cpp:3–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "Time_Check.h"
2
3void Frame_Time_Checker::update()
4{
5 m_frameCount++;
6
7 if (m_updateTimer.getElapsedTime().asSeconds() >= 0.3)
8 {
9 m_fps = m_frameCount / m_timer.getElapsedTime().asMilliseconds();
10 if (m_fps > 0)
11 {
12 m_frameTime = 1.0f / m_fps;
13 }
14 m_fps *= 1000;
15 m_frameCount = 0;
16 m_updateTimer.restart();
17 m_timer.restart();
18 }
19}
20
21const float& Frame_Time_Checker::getFrameTime()
22{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected