feat: Implement timeout mechanism in ApplicationController for headless testing

This commit is contained in:
2026-01-04 13:48:42 +00:00
parent 2869b552a2
commit 92e28f4567

View File

@@ -26,9 +26,19 @@ void ApplicationController::Run() {
running_ = true;
auto lastTime = std::chrono::high_resolution_clock::now();
auto startTime = lastTime;
const auto timeout = std::chrono::seconds(5); // Exit after 5 seconds for testing
while (running_) {
auto currentTime = std::chrono::high_resolution_clock::now();
// Exit after timeout for headless testing
if (currentTime - startTime > timeout) {
logging::Logger::GetInstance().Info("Application timeout reached, exiting");
running_ = false;
break;
}
float deltaTime = std::chrono::duration<float>(currentTime - lastTime).count();
lastTime = currentTime;