diff options
author | erdgeist <> | 2007-10-13 17:40:37 +0000 |
---|---|---|
committer | erdgeist <> | 2007-10-13 17:40:37 +0000 |
commit | 6c1adb8fc8c135cf0c3017e5ca6454747b0153e4 (patch) | |
tree | 7e02a9b7ddb3b37ab443ebf65ddd879d59b75bff /trackerlogic.h | |
parent | 4c15dc7a70b189a7ae2cc66196c42f26881eb85e (diff) |
since gettimeofday is rather expansive, we do only fetch time once in a 5 second period, when we are delivered a SIGALRM.
Diffstat (limited to 'trackerlogic.h')
-rw-r--r-- | trackerlogic.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/trackerlogic.h b/trackerlogic.h index 37e2451..596324e 100644 --- a/trackerlogic.h +++ b/trackerlogic.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <sys/types.h> | 7 | #include <sys/types.h> |
8 | #include <sys/time.h> | 8 | #include <sys/time.h> |
9 | #include <time.h> | 9 | #include <time.h> |
10 | #include <stdint.h> | ||
10 | 11 | ||
11 | /* Should be called BYTE, WORD, DWORD - but some OSs already have that and there's no #iftypedef */ | 12 | /* Should be called BYTE, WORD, DWORD - but some OSs already have that and there's no #iftypedef */ |
12 | /* They mark memory used as data instead of integer or human readable string - | 13 | /* They mark memory used as data instead of integer or human readable string - |
@@ -39,7 +40,9 @@ typedef time_t ot_time; | |||
39 | 40 | ||
40 | #define OT_POOLS_COUNT 9 | 41 | #define OT_POOLS_COUNT 9 |
41 | #define OT_POOLS_TIMEOUT (60*5) | 42 | #define OT_POOLS_TIMEOUT (60*5) |
42 | #define NOW (time(NULL)/OT_POOLS_TIMEOUT) | 43 | |
44 | extern time_t g_now; | ||
45 | #define NOW (g_now/OT_POOLS_TIMEOUT) | ||
43 | 46 | ||
44 | #define OT_VECTOR_MIN_MEMBERS 16 | 47 | #define OT_VECTOR_MIN_MEMBERS 16 |
45 | #define OT_VECTOR_GROW_RATIO 4 | 48 | #define OT_VECTOR_GROW_RATIO 4 |