foo
[eradicate] / src / sdl / timer.c
diff --git a/src/sdl/timer.c b/src/sdl/timer.c
new file mode 100644 (file)
index 0000000..2f2993b
--- /dev/null
@@ -0,0 +1,23 @@
+#include <SDL/SDL.h>
+#include "timer.h"
+
+static unsigned long start_time;
+
+void init_timer(int res_hz)
+{
+}
+
+void reset_timer(void)
+{
+       start_time = SDL_GetTicks();
+}
+
+unsigned long get_msec(void)
+{
+       return SDL_GetTicks() - start_time;
+}
+
+void sleep_msec(unsigned long msec)
+{
+       SDL_Delay(msec);
+}