X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/e1c08c2c174c75d7c5cd2ec5d0b974c6f240ba7e..77428ef82db5a547b2443d6d9632b52bc82f5c19:/projects/stargazer/stg_timer.cpp?ds=inline diff --git a/projects/stargazer/stg_timer.cpp b/projects/stargazer/stg_timer.cpp index b17153cf..6d2b4b0c 100644 --- a/projects/stargazer/stg_timer.cpp +++ b/projects/stargazer/stg_timer.cpp @@ -54,6 +54,8 @@ switch (START_TIME) stgTime = mktime(<); break; } +#else +stgTime = time(NULL); #endif nonstop = 1; @@ -62,12 +64,12 @@ while (nonstop) { #ifdef STG_TIMER_DEBUG struct timespec ts = {0, 1000000000 / TIME_SPEED}; - nanosleep(&ts); + nanosleep(&ts, NULL); //usleep(1000000 / TIME_SPEED); stgTime++; #else struct timespec ts = {0, 500000000}; - nanosleep(&ts); + nanosleep(&ts, NULL); //usleep(500000); stgTime = time(NULL); #endif @@ -109,11 +111,11 @@ int stgUsleep(unsigned long t) { #ifdef STG_TIMER_DEBUG struct timespec ts = {(t / TIME_SPEED) / 1000000, ((t / TIME_SPEED) % 1000000) * 1000}; -return nanosleep(&ts); +return nanosleep(&ts, NULL); //return usleep(t / TIME_SPEED); #else struct timespec ts = {t / 1000000, (t % 1000000) * 1000}; -return nanosleep(&ts); +return nanosleep(&ts, NULL); //return usleep(t); #endif }