diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2012-05-31 07:58:55 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2012-05-31 07:58:55 +0000 |
commit | 0bf708fc555e49d776f383c9bdd665039caa1c4e (patch) | |
tree | 2b1a9ddb440d156052d06a2cf680a33338d83ddb /ACE/ace/High_Res_Timer.inl | |
parent | 4fa463b5f485e7ae7e76982175ac939739cd8199 (diff) | |
download | ATCD-0bf708fc555e49d776f383c9bdd665039caa1c4e.tar.gz |
Thu May 31 07:57:59 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/High_Res_Timer.h:
* ace/Message_Block.h:
Doxygen improvements
* ace/High_Res_Timer.inl:
Use gsf type to prevent overflow
* docs/bczar/bczar.html:
Added some more packages
Diffstat (limited to 'ACE/ace/High_Res_Timer.inl')
-rw-r--r-- | ACE/ace/High_Res_Timer.inl | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/ACE/ace/High_Res_Timer.inl b/ACE/ace/High_Res_Timer.inl index 27d42dbcc44..2f6c1026c35 100644 --- a/ACE/ace/High_Res_Timer.inl +++ b/ACE/ace/High_Res_Timer.inl @@ -1,5 +1,4 @@ // -*- C++ -*- */ -// // $Id$ #include "ace/Global_Macros.h" @@ -10,13 +9,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -// Be very careful before changing the calculations inside -// ACE_High_Res_Timer. The precision matters and we are using integer -// calculations not floating point. Also look closely at the emulated 64 -// bit int class (inside Basic_Types{h,i,cpp} before changing -// anything. It's operator/ only returns 32 bits not 64 bits, among -// other things. - +/// Be very careful before changing the calculations inside +/// ACE_High_Res_Timer. The precision matters and we are using integer +/// calculations not floating point. ACE_INLINE void ACE_High_Res_Timer::hrtime_to_tv (ACE_Time_Value &tv, const ACE_hrtime_t hrt) @@ -43,8 +38,8 @@ ACE_High_Res_Timer::hrtime_to_tv (ACE_Time_Value &tv, // clock ticks to microseconds. tv.sec ((time_t) (hrt / global_scale_factor () )); - // Calculate usec - ACE_hrtime_t tmp = tv.sec (); + // Calculate usec, first calculate the seconds in hrtime + ACE_High_Res_Timer::global_scale_factor_type tmp = tv.sec (); tmp *= global_scale_factor (); tv.usec ((suseconds_t) ((hrt - tmp) * ACE_HR_SCALE_CONVERSION / global_scale_factor ())); #endif @@ -69,13 +64,12 @@ ACE_High_Res_Timer::gettimeofday (const ACE_OS::ACE_HRTimer_Op op) return tv; } - -// Get the current high res timer as the time of day. This is intended -// to be used for a gettimeofday replacement in ACE_Timer_Queue and -// derived classes so the timers will bebased on high res timers rather -// than wall clock time. It uses the ACE_High_Res_Timer::gettimeofday -// function, which is deprecated. If it gets removed, please move the -// code down here, intact. +/// Get the current high res timer as the time of day. This is intended +/// to be used for a gettimeofday replacement in ACE_Timer_Queue and +/// derived classes so the timers will be based on high res timers rather +/// than wall clock time. It uses the ACE_High_Res_Timer::gettimeofday +/// function, which is deprecated. If it gets removed, please move the +/// code down here, intact. ACE_INLINE ACE_Time_Value ACE_High_Res_Timer::gettimeofday_hr (void) { |