maybe fix race condition
All checks were successful
build_test / build (push) Successful in 1m40s

This commit is contained in:
PoliEcho 2025-04-14 13:39:37 +02:00
parent 6001970eca
commit 7dc987ab2c

View File

@ -158,6 +158,7 @@ std::string spawncmd() {
}
void async_clock(WINDOW* win) {
std::this_thread::sleep_for(std::chrono::milliseconds(150));
while (true) {
auto now = std::chrono::system_clock::now();
std::string time_str;
@ -186,13 +187,15 @@ void async_clock(WINDOW* win) {
}
void show_clock_text(WINDOW* text_win) {
std::this_thread::sleep_for(std::chrono::seconds(1));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
wborder(text_win, 0, ' ', 0, 0, 0, ACS_HLINE, 0, ACS_HLINE);
mvwprintw(text_win, 1, 1, "správný čas na podání trestního oznámení je");
wrefresh(text_win);
}
void async_clock_init() {
// program only launches sometimes i think there is race condition
//memory leak
WINDOW* win = newwin(3, 10, LINES - 3, COLS - 10);
box(win, 0, 0);