summaryrefslogtreecommitdiff
path: root/ace/High_Res_Timer.h
diff options
context:
space:
mode:
authorharrison <harrison@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-03-20 07:16:33 +0000
committerharrison <harrison@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-03-20 07:16:33 +0000
commit6e74382a58ccc38b1cab8abf4d10716ad3e13248 (patch)
tree5a776e18167716ed558965f146deb73bc2e3e22f /ace/High_Res_Timer.h
parent3c3bdde446856904eca163ed964ea77db0c0cd7d (diff)
downloadATCD-6e74382a58ccc38b1cab8abf4d10716ad3e13248.tar.gz
Removed scale_factor > 0 checks.
Should work on NT even if global_scale_factor_ is not set.
Diffstat (limited to 'ace/High_Res_Timer.h')
-rw-r--r--ace/High_Res_Timer.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/ace/High_Res_Timer.h b/ace/High_Res_Timer.h
index 42fbcd40dae..b1b2f4f07c1 100644
--- a/ace/High_Res_Timer.h
+++ b/ace/High_Res_Timer.h
@@ -33,12 +33,13 @@ class ACE_Export ACE_High_Res_Timer
// added. It returns 1 if high-resolution time (ACE_OS::gethrtime ())
// is supported on the platform, and 0 if not.
//
- // The optional scale factor is required for platforms that have
- // high-resolution timers that return units other than nanoseconds,
- // such as clock ticks. The member functions that return or print
- // times use this scale factor. They divide the "time" that they
- // get from ACE_OS::gethrtime () by it to obtain the time in nanoseconds.
- // Its units are 1/second, possibly ticks/second.
+ // The scale factor is required for platforms that have
+ // high-resolution timers that return units other than
+ // nanoseconds, such as clock ticks. The member functions that
+ // return or print times use this scale factor. They divide the
+ // "time" that they get from ACE_OS::gethrtime () by it to
+ // obtain the time in nanoseconds. Its units are 1/second,
+ // possibly ticks/second.
//
// NOTE: the elapsed time calculations in the print methods use
// ACE_hrtime_t values. If ACE_hrtime_t is not a 64-bit type
@@ -66,11 +67,16 @@ public:
static ACE_Time_Value gettimeofday (void);
// Calls ACE_High_Res_Timer::hrtime_to_tv passing ACE_OS::gethrtime
// and global_scale_factor_. This function can be used to
- // parameterize objects such as ACE_Timer_Queue::gettimeofday.
+ // parameterize objects such as ACE_Timer_Queue::gettimeofday. If
+ // global_scale_factor_ is not set, and we're on a platform that
+ // requires global_scale_factor_ (e.g., Win32), ACE_OS::gettimeofday
+ // will be used instead of ACE_OS::gethrtime. This allows the
+ // scale_factor of 1 to still result in correct values.
- ACE_High_Res_Timer (double scale_factor = 0);
+ ACE_High_Res_Timer (double scale_factor = 1);
// Initialize the timer. The <scale_factor> takes precedence to
- // global_scale_factor_.
+ // global_scale_factor_. A scale_factor of 1 is a noop. A scale
+ // factor of 0 will cause division by zero exceptions.
void reset (void);
// Reinitialize the timer.