diff options
Diffstat (limited to 'src/Utility.cpp')
-rw-r--r-- | src/Utility.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Utility.cpp b/src/Utility.cpp index 0fb10cf..c498fa3 100644 --- a/src/Utility.cpp +++ b/src/Utility.cpp @@ -37,7 +37,8 @@ GLenum glCheckError_(const char *file, int line) { return errorCode; } -LoopExecutionTimeController::LoopExecutionTimeController(duration delayLength) : delayLength(delayLength) { +LoopExecutionTimeController::LoopExecutionTimeController(duration delayLength) + : delayLength(delayLength) { previousUpdate = clock::now(); } @@ -77,13 +78,11 @@ double LoopExecutionTimeController::GetDeltaS() { return delta.count(); } -double LoopExecutionTimeController::GetRealDeltaS() -{ +double LoopExecutionTimeController::GetRealDeltaS() { return std::chrono::duration<double,std::ratio<1,1>>(previousUpdate - previousPreviousUpdate).count(); } -double LoopExecutionTimeController::RemainTimeMs() -{ +double LoopExecutionTimeController::RemainTimeMs() { auto remain = delayLength - GetDelta(); return remain.count(); } |