2 #include "ace/OS_NS_sys_time.h"
3 #include "ace/High_Res_Timer.h"
5 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
7 ACE_INLINE ACE_Time_Value_T<ACE_Monotonic_Time_Policy>
8 ACE_Monotonic_Time_Policy::operator()() const
10 #if defined (ACE_HAS_MONOTONIC_TIME_POLICY)
11 # if defined (ACE_WIN32)
12 return ACE_Time_Value_T<ACE_Monotonic_Time_Policy> (ACE_High_Res_Timer::gettimeofday_hr ());
13 # elif defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)
16 if (ACE_OS::clock_gettime (CLOCK_MONOTONIC, &ts) == 0)
17 return ACE_Time_Value_T<ACE_Monotonic_Time_Policy>(ts);
19 return ACE_Time_Value_T<ACE_Monotonic_Time_Policy> (ACE_Time_Value::zero);
21 # error "ACE_HAS_MONOTONIC_TIME_POLICY is defined, but no implementation is valid"
22 # endif /* ACE_WIN32 */
23 #else /* !ACE_HAS_MONOTONIC_TIME_POLICY */
24 return ACE_Time_Value_T<ACE_Monotonic_Time_Policy> (ACE_Time_Value::zero);
29 ACE_Monotonic_Time_Policy::set_gettimeofday (ACE_Time_Value (*)(void))
33 ACE_END_VERSIONED_NAMESPACE_DECL