summaryrefslogtreecommitdiff
path: root/ace/High_Res_Timer.i
diff options
context:
space:
mode:
authorharrison <harrison@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-03-23 22:00:58 +0000
committerharrison <harrison@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-03-23 22:00:58 +0000
commitd722774a82b3e5cd089a800ff253ac2b6bc74bbd (patch)
treedcc59b5ecf17c3f9f53e60980f8019a84985826b /ace/High_Res_Timer.i
parent16ef42b56441bc1026241663969d66634724fae4 (diff)
downloadATCD-d722774a82b3e5cd089a800ff253ac2b6bc74bbd.tar.gz
Removed scale_factor from High_Res_Timer constructor.
Diffstat (limited to 'ace/High_Res_Timer.i')
-rw-r--r--ace/High_Res_Timer.i42
1 files changed, 16 insertions, 26 deletions
diff --git a/ace/High_Res_Timer.i b/ace/High_Res_Timer.i
index 913c982fdb9..acd82ea4e14 100644
--- a/ace/High_Res_Timer.i
+++ b/ace/High_Res_Timer.i
@@ -10,18 +10,10 @@ ACE_High_Res_Timer::supported ()
}
ACE_INLINE
-ACE_High_Res_Timer::ACE_High_Res_Timer (u_long scale_factor)
- : scale_factor_ (scale_factor)
+ACE_High_Res_Timer::ACE_High_Res_Timer (void)
{
ACE_TRACE ("ACE_High_Res_Timer::ACE_High_Res_Timer");
- // <scale_factor> takes precendence over the global_scale_factor_.
- // If scale_factor_ is not set (== 1) and a global_scale_factor is
- // set (!= 0), use the global_scale_factor_.
- if (scale_factor_ == 1 &&
- ACE_High_Res_Timer::global_scale_factor_ != 0)
- scale_factor_ = ACE_High_Res_Timer::global_scale_factor_;
-
this->reset ();
}
@@ -56,7 +48,7 @@ ACE_High_Res_Timer::stop_incr (void)
ACE_INLINE void
ACE_High_Res_Timer::elapsed_microseconds (ACE_hrtime_t &usecs) const
{
- usecs = (ACE_hrtime_t) ((this->end_ - this->start_) / scale_factor_);
+ usecs = (ACE_hrtime_t) ((this->end_ - this->start_) / global_scale_factor_);
}
ACE_INLINE void
@@ -67,27 +59,25 @@ ACE_High_Res_Timer::global_scale_factor (u_long gsf)
ACE_INLINE void
ACE_High_Res_Timer::hrtime_to_tv (ACE_Time_Value &tv,
- ACE_hrtime_t hrt,
- u_long scale_factor)
+ ACE_hrtime_t hrt)
{
- tv.sec ((long) (hrt / scale_factor) / 1000000);
- tv.usec ((long) (hrt / scale_factor) % 1000000);
+ tv.sec ((long) (hrt / global_scale_factor_) / 1000000);
+ tv.usec ((long) (hrt / global_scale_factor_) % 1000000);
}
ACE_INLINE ACE_Time_Value
ACE_High_Res_Timer::gettimeofday (void)
{
- // If the global_scale_factor_ == 0, then a scale factor is needed
- // by the platform gethrtime, but a scale factor has not been set.
- // Hence, just return ACE_OS::gettimeofday.
- if (ACE_High_Res_Timer::global_scale_factor_ == 0)
+#if defined (ACE_WIN32)
+ // If the global_scale_factor_ == 1 and we're on an Intel platform,
+ // then a scale factor is needed by the platform gethrtime. Since
+ // one has not been set, just return ACE_OS::gettimeofday.
+ if (ACE_High_Res_Timer::global_scale_factor_ == 1)
return ACE_OS::gettimeofday ();
- else
- {
- ACE_Time_Value tv;
- ACE_High_Res_Timer::hrtime_to_tv (tv,
- ACE_OS::gethrtime (),
- ACE_High_Res_Timer::global_scale_factor_);
- return tv;
- }
+#endif /* ACE_WIN32 */
+
+ ACE_Time_Value tv;
+ ACE_High_Res_Timer::hrtime_to_tv (tv,
+ ACE_OS::gethrtime ());
+ return tv;
}