diff options
author | chai <chaifix@163.com> | 2018-07-28 22:10:27 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-28 22:10:27 +0800 |
commit | 52693d68f7181d707e1a192d67a617145b358394 (patch) | |
tree | 5a39bcdf225def306738ead6683cd224e2c5762d /src/libjin/Time/Timer.h | |
parent | d033400614e7e2c0ff49e5100c81e937e5818e74 (diff) |
*update
Diffstat (limited to 'src/libjin/Time/Timer.h')
-rw-r--r-- | src/libjin/Time/Timer.h | 25 |
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 |