36 #if !defined(USE_GETSYSTEMTIME) && !defined(USE_GETTIMEOFDAY) && !defined(USE_TIME)
37 # if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
38 # define USE_GETSYSTEMTIME
39 # elif defined(unix) || defined(__unix__) || defined(__unix)
41 # if (_POSIX_TIMERS) || (_POSIX_VERSION >= 200112L)
42 # define USE_GETTIMEOFDAY
48 #if defined(USE_GETSYSTEMTIME)
49 #define WIN32_LEAN_AND_MEAN
54 static SYSTEMTIME TimeVal;
55 GetSystemTime(&TimeVal);
56 return (
unsigned long)((
unsigned long)TimeVal.wMilliseconds
57 + 1000*((
unsigned long)TimeVal.wSecond
58 + 60*((
unsigned long)TimeVal.wMinute
59 + 60*((
unsigned long)TimeVal.wHour
60 + 24*(
unsigned long)TimeVal.wDay))));
62 #elif defined(USE_GETTIMEOFDAY)
68 struct timeval TimeVal;
69 gettimeofday(&TimeVal, NULL);
70 return (
unsigned long)(TimeVal.tv_usec/1000 + TimeVal.tv_sec*1000);
80 TimeVal = localtime(&RawTime);
81 return (
unsigned long)(1000*((
unsigned long)TimeVal->tm_sec
82 + 60*((
unsigned long)TimeVal->tm_min
83 + 60*((
unsigned long)TimeVal->tm_hour
84 + 24*(
unsigned long)TimeVal->tm_mday))));
94 if(!(Ptr = malloc(Size)))
95 ErrorMessage(
"Memory allocation of %u bytes failed.\n", Size);
106 if(!(NewPtr = realloc(Ptr, Size)))
108 ErrorMessage(
"Memory reallocation of %u bytes failed.\n", Size);
121 va_start(Args, Format);
123 vfprintf(stderr, Format, Args);