aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Time
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Time')
-rw-r--r--src/libjin/Time/Timer.cpp14
-rw-r--r--src/libjin/Time/Timer.h25
2 files changed, 37 insertions, 2 deletions
diff --git a/src/libjin/Time/Timer.cpp b/src/libjin/Time/Timer.cpp
index e69de29..fe72a90 100644
--- a/src/libjin/Time/Timer.cpp
+++ b/src/libjin/Time/Timer.cpp
@@ -0,0 +1,14 @@
+#include "../modules.h"
+#if JIN_MODULES_TIME
+
+namespace jin
+{
+namespace time
+{
+
+
+
+}
+}
+
+#endif // JIN_MODULES_TIME \ No newline at end of file
diff --git a/src/libjin/Time/Timer.h b/src/libjin/Time/Timer.h
index 1742306..9458215 100644
--- a/src/libjin/Time/Timer.h
+++ b/src/libjin/Time/Timer.h
@@ -3,15 +3,36 @@
#include "../modules.h"
#if JIN_MODULES_TIME
+#include "SDL2/SDL.h"
+
namespace jin
{
namespace time
{
+ inline void sleep(int ms)
+ {
+#if JIN_TIME_SDL
+ SDL_Delay(ms);
+#endif
+ }
+
+ inline double getSecond()
+ {
+#if JIN_TIME_SDL
+ return SDL_GetTicks() / 1000.f;
+#endif
+ }
+ inline double getMilliSecond()
+ {
+#if JIN_TIME_SDL
+ return SDL_GetTicks();
+#endif
+ }
-}
-}
+} // time
+} // jin
#endif // JIN_MODULES_TIME
#endif // __JIN_TIMER_H \ No newline at end of file