MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / update

Method update

testbed/src/Timer.h:164–177  ·  view source on GitHub ↗

Compute the time since the last update() call and add it to the accumulator

Source from the content-addressed store, hash-verified

162
163// Compute the time since the last update() call and add it to the accumulator
164inline void Timer::update() {
165
166 // Get the current system time
167 std::chrono::time_point<clock> currentTime = clock::now();
168
169 // Compute the delta display time between two display frames
170 std::chrono::duration<double> deltaTime = currentTime - mLastUpdateTime;
171
172 // Update the current display time
173 mLastUpdateTime = currentTime;
174
175 // Update the accumulator value
176 mAccumulator += deltaTime;
177}
178
179 #endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected