#include #include #include #include "xcpp/xdisplay.hpp" void threadFunc() { using namespace std::chrono_literals; int repeat = 30; for (int i=0; i < repeat; i++) { std::cout << "(Keep alive "<< i+1 << "/" << repeat << ")" << std::endl << std::flush; // Sleep this thread for 300 Seconds std::this_thread::sleep_for(290s); //300000ms = 300s = 5 min //xcpp::clear_output(true); // prevents flickering } std::cout << "(Keep alive finished)"; } //threadFunc() std::thread th(&threadFunc); th.detach();