]> git.stg.codes - stg.git/blobdiff - projects/stargazer/stg_timer.cpp
Replace -g3 with -ggdb3 (supported by gcc, clang and ekopath compilers)
[stg.git] / projects / stargazer / stg_timer.cpp
index b17153cf6eed25af3bbcd54788db52a7d2e9a2b8..fff79a3918de7ae93e1bb2258e7ebbd942919413 100644 (file)
@@ -3,7 +3,7 @@
 #include <ctime>
 #include <cstring>
 
-#include "common.h"
+#include "stg/common.h"
 
 static int nonstop;
 static pthread_t thrStgTimer;
@@ -54,6 +54,8 @@ switch (START_TIME)
         stgTime = mktime(&lt);
         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
 }