summaryrefslogtreecommitdiff
path: root/ace/High_Res_Timer.i
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-02-03 14:41:57 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-02-03 14:41:57 +0000
commit88915240e589e0c98e668b86250a6f20f2ee2b84 (patch)
tree4d9d36e32b212ecc5b78670ed4b69ae0c69abb3a /ace/High_Res_Timer.i
parentb3a70da9e09c685d604177a1eea488c81c969200 (diff)
downloadATCD-88915240e589e0c98e668b86250a6f20f2ee2b84.tar.gz
changed hrtime_t to ACE_hrtime_t; added unsupported ()
Diffstat (limited to 'ace/High_Res_Timer.i')
-rw-r--r--ace/High_Res_Timer.i36
1 files changed, 21 insertions, 15 deletions
diff --git a/ace/High_Res_Timer.i b/ace/High_Res_Timer.i
index 0a2dd694429..68b5eb3dec8 100644
--- a/ace/High_Res_Timer.i
+++ b/ace/High_Res_Timer.i
@@ -3,6 +3,12 @@
// High_Res_Timer.i
+ACE_INLINE int
+ACE_High_Res_Timer::supported ()
+{
+ return ACE_OS::gethrtime () != -1;
+}
+
ACE_INLINE
ACE_High_Res_Timer::ACE_High_Res_Timer (void)
{
@@ -10,25 +16,25 @@ ACE_High_Res_Timer::ACE_High_Res_Timer (void)
this->reset ();
}
-ACE_INLINE int
+ACE_INLINE void
ACE_High_Res_Timer::start (void)
{
ACE_TRACE ("ACE_High_Res_Timer::start");
- return (int) (this->start_ = ACE_OS::gethrtime ());
+ this->start_ = ACE_OS::gethrtime ();
}
-ACE_INLINE int
+ACE_INLINE void
ACE_High_Res_Timer::stop (void)
{
ACE_TRACE ("ACE_High_Res_Timer::stop");
- return (int) (this->end_ = ACE_OS::gethrtime ());
+ this->end_ = ACE_OS::gethrtime ();
}
-ACE_INLINE void
+ACE_INLINE void
ACE_High_Res_Timer::elapsed_time (ACE_Time_Value &tv)
{
- tv.sec ((this->end_ - this->start_) / 1000000L);
- tv.usec ((this->end_ - this->start_) % 1000000L);
+ tv.sec (this->end_ - this->start_ / 1000000L);
+ tv.usec (this->end_ - this->start_ % 1000000L);
}
#if defined (ACE_HAS_POSIX_TIME)
@@ -40,29 +46,29 @@ ACE_High_Res_Timer::elapsed_time (timespec_t &elapsed_time)
}
#endif /* ACE_HAS_POSIX_TIME */
-ACE_INLINE int
+ACE_INLINE void
ACE_High_Res_Timer::start_incr (void)
{
ACE_TRACE ("ACE_High_Res_Timer::start_incr");
- return (int) (this->start_incr_ = ACE_OS::gethrtime ());
+ this->start_incr_ = ACE_OS::gethrtime ();
}
-ACE_INLINE int
+ACE_INLINE void
ACE_High_Res_Timer::stop_incr (void)
{
ACE_TRACE ("ACE_High_Res_Timer::stop_incr");
- return (int) (this->total_ += (ACE_OS::gethrtime () - this->start_incr_));
+ this->total_ += ACE_OS::gethrtime () - this->start_incr_;
}
-ACE_INLINE void
+ACE_INLINE void
ACE_High_Res_Timer::elapsed_time_incr (ACE_Time_Value &tv)
{
- tv.sec ((this->total_) / 1000000L);
- tv.usec ((this->total_) % 1000000L);
+ tv.sec (this->total_ / 1000000L);
+ tv.usec (this->total_ % 1000000L);
}
ACE_INLINE void
-ACE_High_Res_Timer::elapsed_microseconds (hrtime_t &usecs) const
+ACE_High_Res_Timer::elapsed_microseconds (ACE_hrtime_t &usecs) const
{
usecs = (this->end_ - this->start_) / 1000;
}