7 #ifndef MSynch_AbsoluteTimeout_h 8 #define MSynch_AbsoluteTimeout_h 12 #if defined(_NO_EXCEPTION) 21 struct timeval lTimeValue;
22 const int lResult = ::gettimeofday(&lTimeValue,
NULL);
26 #if !defined(_NO_EXCEPTION) 27 throw (
"::gettimeofday failed");
29 printf(
"%s\n",
"::gettimeofday failed");
34 lTimeValue.tv_sec += iMilliseconds / 1000;
35 lTimeValue.tv_usec += (iMilliseconds % 1000) * 1000;
37 if (lTimeValue.tv_usec >= 1000 * 1000)
40 lTimeValue.tv_sec += 1;
41 lTimeValue.tv_usec -= 1000 * 1000;
44 _ASSERT(lTimeValue.tv_usec < 1000 * 1000);
46 oAbsoluteTimeout.tv_sec = lTimeValue.tv_sec;
47 oAbsoluteTimeout.tv_nsec = lTimeValue.tv_usec * 1000;
52 #endif // MSynch_AbsoluteTimeout_h #define _ASSERT(x)
Definition: Asserte.h:34
Definition: ReferenceCountedImpl.h:18
void GetAbsoluteTimeout(struct timespec &oAbsoluteTimeout, unsigned Int32 iMilliseconds)
Definition: AbsoluteTimeout.h:19
#define Int32
Definition: BasicTypes.h:20
#define NULL
Definition: Null.h:10