diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-13 22:33:05 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-13 22:33:05 +0000 |
commit | 8c2741557e986a77da6eb58cfc4829ffbbc53a7e (patch) | |
tree | eb127d4b5b519fb0d67713d00d3e523a27dfc3eb /ace/Profile_Timer.h | |
parent | e68c220338fccf2048bacb7705ef324fdcbb8a59 (diff) | |
download | ATCD-8c2741557e986a77da6eb58cfc4829ffbbc53a7e.tar.gz |
added ACE_LACKS_FLOATING_POINT support
Diffstat (limited to 'ace/Profile_Timer.h')
-rw-r--r-- | ace/Profile_Timer.h | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/ace/Profile_Timer.h b/ace/Profile_Timer.h index 6776f629771..1dd1720f6af 100644 --- a/ace/Profile_Timer.h +++ b/ace/Profile_Timer.h @@ -1,18 +1,17 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY // ace -// +// // = FILENAME // Profile_Timer.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ #if !defined (ACE_PROFILE_TIMER_H) @@ -22,30 +21,10 @@ #include "ace/Time_Value.h" #include "ace/High_Res_Timer.h" -#if !(defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE)) +#if defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE) class ACE_Export ACE_Profile_Timer { -public: - struct ACE_Elapsed_Time - { - double real_time; - double user_time; - double system_time; - }; - - ACE_Profile_Timer (void); - ~ACE_Profile_Timer (void) {} - int start (void); - int stop (void); - int elapsed_time (ACE_Elapsed_Time &et); - -private: - ACE_High_Res_Timer timer_; -}; -#else -class ACE_Export ACE_Profile_Timer -{ // = TITLE // A C++ wrapper for UNIX interval timers. public: @@ -65,7 +44,7 @@ public: // = Initialization and termination methods. ACE_Profile_Timer (void); // Default constructor. - + ~ACE_Profile_Timer (void); // Shutdown the timer. @@ -81,8 +60,8 @@ public: // Compute the time elapsed since <start>. void elapsed_rusage (ACE_Profile_Timer::Rusage &rusage); - // Compute the amount of resource utilization since the start time. - + // Compute the amount of resource utilization since the start time. + void get_rusage (ACE_Profile_Timer::Rusage &rusage); // Return the resource utilization (don't recompute it). @@ -137,10 +116,38 @@ private: #endif /* ACE_HAS_PRUSAGE_T */ }; -#endif /* defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE) */ +#else /* ! ACE_HAS_PRUSAGE_T && ! ACE_HAS_GETRUSAGE */ + +class ACE_Export ACE_Profile_Timer +{ +public: + struct ACE_Elapsed_Time + { +#if defined (ACE_LACKS_FLOATING_POINT) + ACE_UINT64 real_time; + ACE_UINT64 user_time; + ACE_UINT64 system_time; +#else /* ! ACE_LACKS_FLOATING_POINT */ + double real_time; + double user_time; + double system_time; +#endif /* ! ACE_LACKS_FLOATING_POINT */ + }; + + ACE_Profile_Timer (void); + ~ACE_Profile_Timer (void) {} + int start (void); + int stop (void); + int elapsed_time (ACE_Elapsed_Time &et); + +private: + ACE_High_Res_Timer timer_; +}; + +#endif /* ! ACE_HAS_PRUSAGE_T && ! ACE_HAS_GETRUSAGE */ #if defined (__ACE_INLINE__) -#include "ace/Profile_Timer.i" +# include "ace/Profile_Timer.i" #endif /* __ACE_INLINE__ */ #endif /* ACE_PROFILE_TIMER_H */ |