summaryrefslogtreecommitdiff
path: root/src/common/timer.h
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-24 17:18:26 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-24 17:18:26 +0000
commitbdb9b86170175ac6c98b8c9b1034312a84487f41 (patch)
tree30ddc7fb0c96785b57c5494dd3ff677e3e95eef4 /src/common/timer.h
parent42c34947b229b7eace20dd9f51087a6bd944100a (diff)
downloadhercules-bdb9b86170175ac6c98b8c9b1034312a84487f41.tar.gz
hercules-bdb9b86170175ac6c98b8c9b1034312a84487f41.tar.bz2
hercules-bdb9b86170175ac6c98b8c9b1034312a84487f41.tar.xz
hercules-bdb9b86170175ac6c98b8c9b1034312a84487f41.zip
timers optimization / speed up / bug fix : no freezing mobs
ported from Yor's git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1284 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/timer.h')
-rw-r--r--src/common/timer.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/common/timer.h b/src/common/timer.h
index 57036ae01..81086cb70 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -3,6 +3,12 @@
#ifndef _TIMER_H_
#define _TIMER_H_
+#ifdef __WIN32
+/* We need winsock lib to have timeval struct - windows is weirdo */
+#define __USE_W32_SOCKETS
+#include <windows.h>
+#endif
+
#define BASE_TICK 5
#define TIMER_ONCE_AUTODEL 1
@@ -25,6 +31,10 @@ struct TimerData {
// Function prototype declaration
+#ifdef __WIN32
+void gettimeofday(struct timeval *t, void *dummy);
+#endif
+
unsigned int gettick_nocache(void);
unsigned int gettick(void);
@@ -36,9 +46,10 @@ int addtick_timer(int tid,unsigned int tick);
struct TimerData *get_timer(int tid);
int do_timer(unsigned int tick);
-void timer_final();
int add_timer_func_list(int (*)(int,unsigned int,int,int),char*);
char* search_timer_func_list(int (*)(int,unsigned int,int,int));
+void timer_final();
+
#endif // _TIMER_H_