From 6c1adb8fc8c135cf0c3017e5ca6454747b0153e4 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Sat, 13 Oct 2007 17:40:37 +0000 Subject: since gettimeofday is rather expansive, we do only fetch time once in a 5 second period, when we are delivered a SIGALRM. --- trackerlogic.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'trackerlogic.h') diff --git a/trackerlogic.h b/trackerlogic.h index 37e2451..596324e 100644 --- a/trackerlogic.h +++ b/trackerlogic.h @@ -7,6 +7,7 @@ #include #include #include +#include /* Should be called BYTE, WORD, DWORD - but some OSs already have that and there's no #iftypedef */ /* They mark memory used as data instead of integer or human readable string - @@ -39,7 +40,9 @@ typedef time_t ot_time; #define OT_POOLS_COUNT 9 #define OT_POOLS_TIMEOUT (60*5) -#define NOW (time(NULL)/OT_POOLS_TIMEOUT) + +extern time_t g_now; +#define NOW (g_now/OT_POOLS_TIMEOUT) #define OT_VECTOR_MIN_MEMBERS 16 #define OT_VECTOR_GROW_RATIO 4 -- cgit v1.2.3