summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ace/High_Res_Timer.cpp9
-rw-r--r--ace/High_Res_Timer.h4
2 files changed, 12 insertions, 1 deletions
diff --git a/ace/High_Res_Timer.cpp b/ace/High_Res_Timer.cpp
index 1b405e4e09a..520c9d4b2c6 100644
--- a/ace/High_Res_Timer.cpp
+++ b/ace/High_Res_Timer.cpp
@@ -282,7 +282,14 @@ ACE_High_Res_Timer::elapsed_time (ACE_hrtime_t &nanoseconds) const
// Please do _not_ rearrange this equation. It is carefully
// designed and tested to avoid overflow on machines that
// don't have native 64-bit ints.
- nanoseconds = (this->end_ - this->start_) * (1000u / global_scale_factor ());
+ nanoseconds = (this->end_ - this->start_) * (1000u / this->global_scale_factor ());
+}
+
+void
+ACE_High_Res_Timer::elapsed_time_incr (ACE_hrtime_t &nanoseconds) const
+{
+ // Same as above.
+ nanoseconds = this->total_ * (1000u / this->global_scale_factor ());
}
#if !defined (ACE_HAS_WINCE)
diff --git a/ace/High_Res_Timer.h b/ace/High_Res_Timer.h
index 527b47b3abe..6fca8eecfaa 100644
--- a/ace/High_Res_Timer.h
+++ b/ace/High_Res_Timer.h
@@ -138,6 +138,10 @@ public:
// Set <tv> to the number of microseconds elapsed between all
// calls to start_incr and stop_incr.
+ void elapsed_time_incr (ACE_hrtime_t &nanoseconds) const;
+ // Set <nsec> to the number of nanoseconds elapsed between all
+ // calls to start_incr and stop_incr.
+
#if !defined (ACE_HAS_WINCE)
// @@ These two functions are currently not supported on Windows CE.
// However, we should probably use the handle and ACE_Log_Msg to