A high resolution timer class wrapper that encapsulates OS-specific high-resolution timers, such as those found on Solaris, AIX, Win32/Pentium, and VxWorks. More...
#include <High_Res_Timer.h>
Public Member Functions | |
ACE_High_Res_Timer (void) | |
Initialize the timer. | |
~ACE_High_Res_Timer (void) | |
Destructor. | |
void | reset (void) |
Reinitialize the timer. | |
void | start (const ACE_OS::ACE_HRTimer_Op=ACE_OS::ACE_HRTIMER_GETTIME) |
Start timing. | |
void | stop (const ACE_OS::ACE_HRTimer_Op=ACE_OS::ACE_HRTIMER_GETTIME) |
Stop timing. | |
void | elapsed_time (ACE_Time_Value &tv) const |
Set tv to the number of microseconds elapsed. | |
void | elapsed_time (ACE_hrtime_t &nanoseconds) const |
Set nanoseconds to the number of nanoseconds elapsed. | |
void | elapsed_microseconds (ACE_hrtime_t &usecs) const |
Sets usecs to the elapsed (stop - start) time in microseconds. | |
void | start_incr (const ACE_OS::ACE_HRTimer_Op=ACE_OS::ACE_HRTIMER_GETTIME) |
Start incremental timing. | |
void | stop_incr (const ACE_OS::ACE_HRTimer_Op=ACE_OS::ACE_HRTIMER_GETTIME) |
Stop incremental timing. | |
void | elapsed_time_incr (ACE_Time_Value &tv) const |
void | elapsed_time_incr (ACE_hrtime_t &nanoseconds) const |
void | print_total (const ACE_TCHAR *message, const int iterations=1, ACE_HANDLE handle=ACE_STDOUT) const |
void | print_ave (const ACE_TCHAR *message, const int iterations=1, ACE_HANDLE handle=ACE_STDOUT) const |
Print average time. | |
void | dump (void) const |
Dump the state of an object. | |
Static Public Member Functions | |
static void | global_scale_factor (ACE_UINT32 gsf) |
static ACE_UINT32 | global_scale_factor (void) |
Returns the global_scale_factor. | |
static int | get_env_global_scale_factor (const ACE_TCHAR *env=ACE_TEXT("ACE_SCALE_FACTOR")) |
static ACE_UINT32 | calibrate (const ACE_UINT32 usec=500000, const u_int iterations=10) |
static ACE_Time_Value | gettimeofday_hr (void) |
static ACE_Time_Value | gettimeofday (const ACE_OS::ACE_HRTimer_Op=ACE_OS::ACE_HRTIMER_GETTIME) |
static void | hrtime_to_tv (ACE_Time_Value &tv, const ACE_hrtime_t hrt) |
Converts an hrt to tv using global_scale_factor_. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Static Private Member Functions | |
static ACE_hrtime_t | gettime (const ACE_OS::ACE_HRTimer_Op=ACE_OS::ACE_HRTIMER_GETTIME) |
static ACE_hrtime_t | elapsed_hrtime (const ACE_hrtime_t end, const ACE_hrtime_t start) |
Private Attributes | |
ACE_hrtime_t | start_ |
Starting time. | |
ACE_hrtime_t | end_ |
Ending time. | |
ACE_hrtime_t | total_ |
Total elapsed time. | |
ACE_hrtime_t | start_incr_ |
Start time of incremental timing. | |
Static Private Attributes | |
static ACE_UINT32 | global_scale_factor_ = 1000u |
static int | global_scale_factor_status_ = 0 |
A high resolution timer class wrapper that encapsulates OS-specific high-resolution timers, such as those found on Solaris, AIX, Win32/Pentium, and VxWorks.
Most of the member functions don't return values. The only reason that one would fail is if high-resolution time isn't supported on the platform. To avoid impacting performance and complicating the interface, in that case, <ACE_OS::gettimeofday> is used instead. The global scale factor is required for platforms that have high-resolution timers that return units other than microseconds, such as clock ticks. It is represented as a static u_long, can only be accessed through static methods, and is used by all instances of High Res Timer. The member functions that return or print times use the global scale factor. They divide the "time" that they get from <ACE_OS::gethrtime> by global_scale_factor_ to obtain the time in microseconds. Its units are therefore 1/microsecond. On Windows the global_scale_factor_ units are 1/millisecond. There's a macro <ACE_HR_SCALE_CONVERSION> which gives the units/second. Because it's possible that the units/second changes in the future, it's recommended to use it instead of a "hard coded" solution. Dependend on the platform and used class members, there's a maximum elapsed period before overflow (which is not checked). Look at the documentation with some members functions. On some (most?) implementations it's not recommended to measure "long" timeperiods, because the error's can accumulate fast. This is probably not a problem profiling code, but could be on if the high resolution timer class is used to initiate actions after a "long" timeout. On Solaris, a scale factor of 1000 should be used because its high-resolution timer returns nanoseconds. However, on Intel platforms, we use RDTSC which returns the number of clock ticks since system boot. For a 200MHz cpu, each clock tick is 1/200 of a microsecond; the global_scale_factor_ should therefore be 200 or 200000 if it's in unit/millisecond. On Windows QueryPerformanceCounter() is used, which can be a different implementation depending on the used windows HAL (Hardware Abstraction Layer). On some it uses the PC "timer chip" while it uses RDTSC on others.
Definition at line 100 of file High_Res_Timer.h.
ACE_High_Res_Timer::ACE_High_Res_Timer | ( | void | ) |
Initialize the timer.
Definition at line 256 of file High_Res_Timer.cpp.
{ ACE_TRACE ("ACE_High_Res_Timer::ACE_High_Res_Timer"); this->reset (); // Make sure that the global scale factor is set. (void) global_scale_factor (); }
ACE_High_Res_Timer::~ACE_High_Res_Timer | ( | void | ) | [inline] |
ACE_UINT32 ACE_High_Res_Timer::calibrate | ( | const ACE_UINT32 | usec = 500000 , |
|
const u_int | iterations = 10 | |||
) | [static] |
Set (and return, for info) the global scale factor by sleeping for usec and counting the number of intervening clock cycles. Average over iterations of usec each. On some platforms, such as Pentiums, this is called automatically during the first ACE_High_Res_Timer construction with the default parameter values. An application can override that by calling calibrate with any desired parameter values _prior_ to constructing the first ACE_High_Res_Timer instance. Beware for platforms that can change the cycle rate on the fly.
Definition at line 267 of file High_Res_Timer.cpp.
{ const ACE_Time_Value sleep_time (0, usec); ACE_Stats delta_hrtime; // In units of 100 usec, to avoid overflow. ACE_Stats actual_sleeps; for (u_int i = 0; i < iterations; ++i) { ACE_Time_Value const actual_start = ACE_OS::gettimeofday (); ACE_hrtime_t const start = ACE_OS::gethrtime (); ACE_OS::sleep (sleep_time); ACE_hrtime_t const stop = ACE_OS::gethrtime (); ACE_Time_Value const actual_delta = ACE_OS::gettimeofday () - actual_start; // Store the sample. delta_hrtime.sample (ACE_Utils::truncate_cast<ACE_INT32> (stop - start)); actual_sleeps.sample (actual_delta.msec () * 100u); } // Calculate the mean value of the samples, with no fractional // precision. Use it for the global scale factor. ACE_Stats_Value ticks (0); delta_hrtime.mean (ticks); ACE_Stats_Value actual_sleep (0); actual_sleeps.mean (actual_sleep); // The addition of 5 below rounds instead of truncates. const ACE_UINT32 scale_factor = (ticks.whole () / actual_sleep.whole () + 5) / 10u /* usec/100 usec */; ACE_High_Res_Timer::global_scale_factor (scale_factor); return scale_factor; }
void ACE_High_Res_Timer::dump | ( | void | ) | const |
Dump the state of an object.
Definition at line 309 of file High_Res_Timer.cpp.
{ #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_High_Res_Timer::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nglobal_scale_factor_: %u\n"), global_scale_factor ())); #if defined (ACE_LACKS_LONGLONG_T) ACE_DEBUG ((LM_DEBUG, ACE_TEXT (":\nstart_.hi (): %8x; start_.lo (): %8x;\n") ACE_TEXT ("end_.hi (): %8x; end_.lo (): %8x;\n") ACE_TEXT ("total_.hi (): %8x; total_.lo (): %8x;\n") ACE_TEXT ("start_incr_.hi () %8x; start_incr_.lo (): %8x;\n"), start_.hi (), start_.lo (), end_.hi (), end_.lo (), total_.hi (), total_.lo (), start_incr_.hi (), start_incr_.lo ())); #else /* ! ACE_LACKS_LONGLONG_T */ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (":\nstart_.hi (): %8x; start_.lo (): %8x;\n") ACE_TEXT ("end_.hi (): %8x; end_.lo (): %8x;\n") ACE_TEXT ("total_.hi (): %8x; total_.lo (): %8x;\n") ACE_TEXT ("start_incr_.hi () %8x; start_incr_.lo (): %8x;\n"), static_cast<ACE_UINT32> (start_ >> 32), static_cast<ACE_UINT32> (start_ & 0xfffffffful), static_cast<ACE_UINT32> (end_ >> 32), static_cast<ACE_UINT32> (end_ & 0xfffffffful), static_cast<ACE_UINT32> (total_ >> 32), static_cast<ACE_UINT32> (total_ & 0xfffffffful), static_cast<ACE_UINT32> (start_incr_ >> 32), static_cast<ACE_UINT32> (start_incr_ & 0xfffffffful))); #endif /* ! ACE_LACKS_LONGLONG_T */ ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ }
ACE_hrtime_t ACE_High_Res_Timer::elapsed_hrtime | ( | const ACE_hrtime_t | end, | |
const ACE_hrtime_t | start | |||
) | [inline, static, private] |
Calculate the difference between two ACE_hrtime_t values. It is assumed that the end time is later than start time, so if end is a smaller value, the time counter has wrapped around.
Definition at line 96 of file High_Res_Timer.inl.
{ if (end > start) return end - start; return (~start + 1 + end); // Wrapped-around counter diff }
void ACE_High_Res_Timer::elapsed_microseconds | ( | ACE_hrtime_t & | usecs | ) | const [inline] |
Sets usecs to the elapsed (stop - start) time in microseconds.
Will overflow on windows when measuring more than appox. 2^^54 ticks. Is still more than 48 days with a 4 Ghz counter.
Definition at line 140 of file High_Res_Timer.inl.
{ ACE_hrtime_t elapsed = ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_); usecs = (ACE_hrtime_t) (elapsed / global_scale_factor ()); }
void ACE_High_Res_Timer::elapsed_time | ( | ACE_hrtime_t & | nanoseconds | ) | const |
Set nanoseconds to the number of nanoseconds elapsed.
Will overflow when measuring more than 194 day's.
Definition at line 401 of file High_Res_Timer.cpp.
{ // 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. In particular, division can be a problem. // For more background on this, please see bugzilla #1024. nanoseconds = ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_) * (1024000u / ACE_High_Res_Timer::global_scale_factor ()); // Caution - Borland has a problem with >>=, so resist the temptation. nanoseconds = nanoseconds >> 10; // Right shift is implemented for non native 64-bit ints // operator/ only for a 32 bit result ! }
void ACE_High_Res_Timer::elapsed_time | ( | ACE_Time_Value & | tv | ) | const |
Set tv to the number of microseconds elapsed.
Could overflow within hours on windows with emulated 64 bit int's and a fast counter. VC++ and Borland normaly use __int64 and so normaly don't have this problem.
Definition at line 358 of file High_Res_Timer.cpp.
{ hrtime_to_tv (tv, ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_)); }
void ACE_High_Res_Timer::elapsed_time_incr | ( | ACE_Time_Value & | tv | ) | const |
Set tv to the number of microseconds elapsed between all calls to start_incr and stop_incr.
Definition at line 395 of file High_Res_Timer.cpp.
{ hrtime_to_tv (tv, total_); }
void ACE_High_Res_Timer::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.
Definition at line 416 of file High_Res_Timer.cpp.
{ // Same as above. nanoseconds = this->total_ * (1024000u / ACE_High_Res_Timer::global_scale_factor ()); // Caution - Borland has a problem with >>=, so resist the temptation. nanoseconds = nanoseconds >> 10; }
int ACE_High_Res_Timer::get_env_global_scale_factor | ( | const ACE_TCHAR * | env = ACE_TEXT ("ACE_SCALE_FACTOR") |
) | [static] |
Sets the global_scale_factor to the value in the env environment variable. Returns 0 on success, -1 on failure.
Definition at line 511 of file High_Res_Timer.cpp.
{ if (env != 0) { const char *env_value = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (env)); if (env_value != 0) { int const value = ACE_OS::atoi (env_value); if (value > 0) { ACE_High_Res_Timer::global_scale_factor (value); return 0; } } } return -1; }
ACE_hrtime_t ACE_High_Res_Timer::gettime | ( | const ACE_OS::ACE_HRTimer_Op | op = ACE_OS::ACE_HRTIMER_GETTIME |
) | [inline, static, private] |
For internal use: gets the high-resolution time using <ACE_OS::gethrtime>. Except on platforms that require that the <global_scale_factor_> be set, such as ACE_WIN32, uses the low-resolution clock if the <global_scale_factor_> has not been set.
Definition at line 75 of file High_Res_Timer.inl.
{ #if defined (ACE_WIN32) // Get the global scale factor if there isn't one yet. if (ACE_High_Res_Timer::global_scale_factor_status_ == 0) ACE_High_Res_Timer::global_scale_factor (); // If there isn't a high-res timer, use gettimeofday (); if (ACE_High_Res_Timer::global_scale_factor_status_ == -1) { ACE_Time_Value const tv = ACE_OS::gettimeofday (); // Return the time in microseconds because the global_scale_factor_ // is 1. return tv.sec () * ACE_ONE_SECOND_IN_USECS + tv.usec (); } #endif /* ACE_WIN32 */ return ACE_OS::gethrtime (op); }
ACE_Time_Value ACE_High_Res_Timer::gettimeofday | ( | const ACE_OS::ACE_HRTimer_Op | op = ACE_OS::ACE_HRTIMER_GETTIME |
) | [inline, static] |
Definition at line 43 of file High_Res_Timer.inl.
{ #if defined (ACE_WIN32) // Get the global scale factor if there isn't one yet. if (ACE_High_Res_Timer::global_scale_factor_status_ == 0) ACE_High_Res_Timer::global_scale_factor (); // If there isn't a high-res timer, use gettimeofday (); if (ACE_High_Res_Timer::global_scale_factor_status_ == -1) return ACE_OS::gettimeofday (); #endif /* ACE_WIN32 */ ACE_Time_Value tv; ACE_High_Res_Timer::hrtime_to_tv (tv, ACE_OS::gethrtime (op)); return tv; }
ACE_Time_Value ACE_High_Res_Timer::gettimeofday_hr | ( | void | ) | [inline, static] |
Get the current "time" as the high resolution counter at this time. This is intended to be useful for supplying to a ACE_Timer_Queue as the gettimeofday function, thereby basing the timer calculations on the high res timer rather than wall clock time.
Definition at line 68 of file High_Res_Timer.inl.
{ return ACE_High_Res_Timer::gettimeofday (); }
ACE_UINT32 ACE_High_Res_Timer::global_scale_factor | ( | void | ) | [static] |
Returns the global_scale_factor.
Definition at line 194 of file High_Res_Timer.cpp.
{ #if (defined (ACE_WIN32) || defined (ACE_HAS_POWERPC_TIMER) || \ defined (ACE_HAS_PENTIUM) || defined (ACE_HAS_ALPHA_TIMER)) && \ !defined (ACE_HAS_HI_RES_TIMER) && \ (defined (ACE_WIN32) || \ defined (ghs) || defined (__GNUG__) || \ defined (__INTEL_COMPILER)) // Check if the global scale factor needs to be set, and do if so. if (ACE_High_Res_Timer::global_scale_factor_status_ == 0) { // Grab ACE's static object lock. This doesn't have anything to // do with static objects; it's just a convenient lock to use. ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance (), 0)); // Double check if (ACE_High_Res_Timer::global_scale_factor_status_ == 0) { # if defined (ACE_WIN32) LARGE_INTEGER freq; if (::QueryPerformanceFrequency (&freq)) { // We have a high-res timer # if defined (ACE_LACKS_LONGLONG_T) ACE_UINT64 uint64_freq(freq.u.LowPart, (ACE_UINT32) freq.u.HighPart); ACE_High_Res_Timer::global_scale_factor (uint64_freq / (ACE_UINT32) ACE_ONE_SECOND_IN_USECS); # else ACE_High_Res_Timer::global_scale_factor (static_cast<unsigned int> (freq.QuadPart / ACE_HR_SCALE_CONVERSION)); # endif // (ACE_LACKS_LONGLONG_T) ACE_High_Res_Timer::global_scale_factor_status_ = 1; } else // High-Res timers not supported ACE_High_Res_Timer::global_scale_factor_status_ = -1; return ACE_High_Res_Timer::global_scale_factor_; # elif defined (linux) ACE_High_Res_Timer::global_scale_factor (ACE_High_Res_Timer::get_cpuinfo ()); # endif /* ! ACE_WIN32 && ! (linux && __alpha__) */ # if !defined (ACE_WIN32) if (ACE_High_Res_Timer::global_scale_factor_ <= 1u) // Failed to retrieve CPU speed from system, so calculate it. ACE_High_Res_Timer::calibrate (); # endif // (ACE_WIN32) } } ACE_High_Res_Timer::global_scale_factor_status_ = 1; #endif /* (ACE_WIN32 || ACE_HAS_POWERPC_TIMER || \ ACE_HAS_PENTIUM || ACE_HAS_ALPHA_TIMER) && \ ! ACE_HAS_HI_RES_TIMER && ((WIN32 && ! WINCE) || ghs || __GNUG__) */ return ACE_High_Res_Timer::global_scale_factor_; }
void ACE_High_Res_Timer::global_scale_factor | ( | ACE_UINT32 | gsf | ) | [inline, static] |
global_scale_factor_ is set to gsf. All High_Res_Timers use global_scale_factor_. This allows applications to set the scale factor just once for all High_Res_Timers. Check High_Res_Timer.cpp for the default global_scale_factors for several platforms. For many platforms (e.g., Solaris), the global_scale_factor_ is set to 1000 so that <scale_factor> need not be set. Careful, a <scale_factor> of 0 will cause division by zero exceptions. Depending on the platform its units are 1/microsecond or 1/millisecond. Use <ACE_HR_SCALE_CONVERSION> inside calculations instead a hardcoded value.
Definition at line 148 of file High_Res_Timer.inl.
{ global_scale_factor_ = gsf; }
void ACE_High_Res_Timer::hrtime_to_tv | ( | ACE_Time_Value & | tv, | |
const ACE_hrtime_t | hrt | |||
) | [inline, static] |
Converts an hrt to tv using global_scale_factor_.
Definition at line 21 of file High_Res_Timer.inl.
{ // The following are based on the units of global_scale_factor_ // being 1/microsecond. Therefore, dividing by it converts // clock ticks to microseconds. tv.sec ((long) (hrt / (ACE_UINT32) ACE_HR_SCALE_CONVERSION / global_scale_factor ())); // Calculate usec in a manner that's compatible with ACE_U_LongLong. // hrt = (tv.sec * ACE_ONE_SECOND_IN_USECS + tv.usec) * global_scale_factor_ // tv.usec = hrt / global_scale_factor_ - tv.sec * ACE_ONE_SECOND_IN_USECS // That first term will be lossy, so factor out global_scale_factor_: // tv.usec = (hrt - tv.sec * ACE_ONE_SECOND_IN_USECS * global_scale_factor_)/ // global_scale_factor ACE_hrtime_t tmp = tv.sec (); tmp *= ((ACE_UINT32) ACE_HR_SCALE_CONVERSION * global_scale_factor ()); tv.usec ((long) ((hrt - tmp) / global_scale_factor ())); }
void ACE_High_Res_Timer::print_ave | ( | const ACE_TCHAR * | message, | |
const int | iterations = 1 , |
|||
ACE_HANDLE | handle = ACE_STDOUT | |||
) | const |
Print average time.
Definition at line 426 of file High_Res_Timer.cpp.
{ ACE_TRACE ("ACE_High_Res_Timer::print_ave"); // Get the total number of nanoseconds elapsed. ACE_hrtime_t total_nanoseconds; this->elapsed_time (total_nanoseconds); // Separate to seconds and nanoseconds. u_long total_secs = static_cast<u_long> (total_nanoseconds / (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); ACE_UINT32 extra_nsecs = static_cast<ACE_UINT32> (total_nanoseconds % (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); ACE_TCHAR buf[100]; if (count > 1) { ACE_hrtime_t avg_nsecs = total_nanoseconds / (ACE_UINT32) count; ACE_OS::sprintf (buf, ACE_TEXT (" count = %d, total (secs %lu, usecs %u), avg usecs = %lu\n"), count, total_secs, (extra_nsecs + 500u) / 1000u, (u_long) ((avg_nsecs + 500u) / 1000u)); } else ACE_OS::sprintf (buf, ACE_TEXT (" total %3lu.%06lu secs\n"), total_secs, (extra_nsecs + 500lu) / 1000lu); ACE_OS::write (handle, str, ACE_OS::strlen (str)); ACE_OS::write (handle, buf, ACE_OS::strlen (buf)); }
void ACE_High_Res_Timer::print_total | ( | const ACE_TCHAR * | message, | |
const int | iterations = 1 , |
|||
ACE_HANDLE | handle = ACE_STDOUT | |||
) | const |
Print total time.
print_total
if incremental timings had been used! Definition at line 468 of file High_Res_Timer.cpp.
{ ACE_TRACE ("ACE_High_Res_Timer::print_total"); // Get the total number of nanoseconds elapsed. ACE_hrtime_t total_nanoseconds; this->elapsed_time (total_nanoseconds); // Separate to seconds and nanoseconds. u_long total_secs = static_cast<u_long> (total_nanoseconds / (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); ACE_UINT32 extra_nsecs = static_cast<ACE_UINT32> (total_nanoseconds % (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); ACE_TCHAR buf[100]; if (count > 1) { ACE_hrtime_t avg_nsecs = this->total_ / (ACE_UINT32) count; ACE_OS::sprintf (buf, ACE_TEXT (" count = %d, total (secs %lu, usecs %u), avg usecs = %lu\n"), count, total_secs, (extra_nsecs + 500u) / 1000u, (u_long) ((avg_nsecs + 500u) / 1000u)); } else ACE_OS::sprintf (buf, ACE_TEXT (" total %3lu.%06u secs\n"), total_secs, (extra_nsecs + 500u) / 1000u); ACE_OS::write (handle, str, ACE_OS::strlen (str)); ACE_OS::write (handle, buf, ACE_OS::strlen (buf)); }
void ACE_High_Res_Timer::reset | ( | void | ) |
Reinitialize the timer.
Definition at line 347 of file High_Res_Timer.cpp.
{ ACE_TRACE ("ACE_High_Res_Timer::reset"); this->start_ = 0; this->end_ = 0; this->total_ = 0; this->start_incr_ = 0; }
void ACE_High_Res_Timer::start | ( | const ACE_OS::ACE_HRTimer_Op | op = ACE_OS::ACE_HRTIMER_GETTIME |
) | [inline] |
Start timing.
Definition at line 110 of file High_Res_Timer.inl.
{ ACE_TRACE ("ACE_High_Res_Timer::start"); this->start_ = ACE_High_Res_Timer::gettime (op); }
void ACE_High_Res_Timer::start_incr | ( | const ACE_OS::ACE_HRTimer_Op | op = ACE_OS::ACE_HRTIMER_GETTIME |
) | [inline] |
Start incremental timing.
Definition at line 124 of file High_Res_Timer.inl.
{ ACE_TRACE ("ACE_High_Res_Timer::start_incr"); this->start_incr_ = ACE_High_Res_Timer::gettime (op); }
void ACE_High_Res_Timer::stop | ( | const ACE_OS::ACE_HRTimer_Op | op = ACE_OS::ACE_HRTIMER_GETTIME |
) | [inline] |
Stop timing.
Definition at line 117 of file High_Res_Timer.inl.
{ ACE_TRACE ("ACE_High_Res_Timer::stop"); this->end_ = ACE_High_Res_Timer::gettime (op); }
void ACE_High_Res_Timer::stop_incr | ( | const ACE_OS::ACE_HRTimer_Op | op = ACE_OS::ACE_HRTIMER_GETTIME |
) | [inline] |
Stop incremental timing.
Definition at line 131 of file High_Res_Timer.inl.
{ ACE_TRACE ("ACE_High_Res_Timer::stop_incr"); this->total_ += ACE_High_Res_Timer::elapsed_hrtime (ACE_High_Res_Timer::gettime (op), this->start_incr_); }
Declare the dynamic allocation hooks.
Definition at line 222 of file High_Res_Timer.h.
ACE_hrtime_t ACE_High_Res_Timer::end_ [private] |
Ending time.
Definition at line 282 of file High_Res_Timer.h.
ACE_UINT32 ACE_High_Res_Timer::global_scale_factor_ = 1000u [static, private] |
Converts ticks to microseconds. That is, ticks / global_scale_factor_ == microseconds.
Definition at line 292 of file High_Res_Timer.h.
int ACE_High_Res_Timer::global_scale_factor_status_ = 0 [static, private] |
Indicates the status of the global scale factor, 0 = hasn't been set 1 = been set -1 = HR timer not supported
Definition at line 300 of file High_Res_Timer.h.
ACE_hrtime_t ACE_High_Res_Timer::start_ [private] |
Starting time.
Definition at line 279 of file High_Res_Timer.h.
ACE_hrtime_t ACE_High_Res_Timer::start_incr_ [private] |
Start time of incremental timing.
Definition at line 288 of file High_Res_Timer.h.
ACE_hrtime_t ACE_High_Res_Timer::total_ [private] |
Total elapsed time.
Definition at line 285 of file High_Res_Timer.h.