Compute the time since the last update() call and add it to the accumulator
| 162 | |
| 163 | // Compute the time since the last update() call and add it to the accumulator |
| 164 | inline 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 |
nothing calls this directly
no outgoing calls
no test coverage detected