Removed some unnecessary time measurement constants.

This commit is contained in:
Leon Styhre 2022-01-09 23:50:08 +01:00
parent aeb0292a3e
commit f80658696c
4 changed files with 11 additions and 14 deletions

View file

@ -99,12 +99,11 @@ void MiximageGenerator::startThread(std::promise<bool>* miximagePromise)
return;
}
else {
const auto endTime = std::chrono::system_clock::now();
LOG(LogDebug)
<< "MiximageGenerator::MiximageGenerator(): Processing completed in: "
<< std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime).count()
<< " ms";
LOG(LogDebug) << "MiximageGenerator::MiximageGenerator(): Processing completed in: "
<< std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::system_clock::now() - startTime)
.count()
<< " ms";
}
mResultMessage = mMessage;

View file

@ -627,11 +627,10 @@ int main(int argc, char* argv[])
SDL_GameControllerEventState(SDL_ENABLE);
int lastTime = SDL_GetTicks();
const auto applicationEndTime = std::chrono::system_clock::now();
LOG(LogInfo) << "Application startup time: "
<< std::chrono::duration_cast<std::chrono::milliseconds>(applicationEndTime -
applicationStartTime)
<< std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::system_clock::now() - applicationStartTime)
.count()
<< " ms";

View file

@ -510,10 +510,9 @@ void Window::render()
mCachedBackground = true;
#if (CLOCK_BACKGROUND_CREATION)
const auto backgroundEndTime = std::chrono::system_clock::now();
LOG(LogDebug) << "Window::render(): Time to create cached background: "
<< std::chrono::duration_cast<std::chrono::milliseconds>(
backgroundEndTime - backgroundStartTime)
std::chrono::system_clock::now() - backgroundStartTime)
.count()
<< " ms";
#endif

View file

@ -438,10 +438,10 @@ namespace Renderer
// application functioning normally.
const auto beforeSwap = std::chrono::system_clock::now();
SDL_GL_SwapWindow(getSDLWindow());
const auto afterSwap = std::chrono::system_clock::now();
if (std::chrono::duration_cast<std::chrono::milliseconds>(afterSwap - beforeSwap).count() <
3.0)
if (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() -
beforeSwap)
.count() < 3.0)
SDL_Delay(10);
#else
SDL_GL_SwapWindow(getSDLWindow());