blob: 9458215b9cb0ed89821ae8459b50311601e5ebd9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#ifndef __JIN_TIMER_H
#define __JIN_TIMER_H
#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
|