Skip to content

Commit

Permalink
Remove redundant initialisation of spareTime
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthayhurst committed Sep 3, 2024
1 parent 4c842c8 commit a199eac
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ammonite/graphics/renderHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ namespace ammonite {
static double maxError = (1.0 / 50000.0);
#define errorAdjustCoeff 1.01

//Figure out time budget remaining
double const targetFrameTime = 1.0 / *frameLimitPtr;
double spareTime = targetFrameTime - targetFrameTimer.getTime();

//Sleep for successively shorter intervals until the frametime budget is gone
double spareTime;
const double targetFrameTime = 1.0 / *frameLimitPtr;
while (targetFrameTime - targetFrameTimer.getTime() > maxError) {
spareTime = targetFrameTime - targetFrameTimer.getTime();
const auto sleepLength = std::chrono::nanoseconds(
Expand Down

0 comments on commit a199eac

Please sign in to comment.