aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Time/Timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Time/Timer.h')
-rw-r--r--src/libjin/Time/Timer.h25
1 files changed, 23 insertions, 2 deletions
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