diff options
Diffstat (limited to 'ace/Time_Value.h')
-rw-r--r-- | ace/Time_Value.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/ace/Time_Value.h b/ace/Time_Value.h index ec2d5aebabf..823d87d94c5 100644 --- a/ace/Time_Value.h +++ b/ace/Time_Value.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY @@ -248,6 +247,40 @@ private: // Microseconds. }; +class ACE_Export ACE_Countdown_Time + // = TITLE + // Keeps track of the amount of elapsed time. + // + // = DESCRIPTION + // This class has a side-effect on the <max_wait_time> -- every + // time the <stop> method is called the <max_wait_time> is + // updated. +{ +public: + // = Initialization and termination methods. + ACE_Countdown_Time (ACE_Time_Value *max_wait_time); + // Cache the <max_wait_time> and call <start>. + + ~ACE_Countdown_Time (void); + // Call <stop>. + + int start (void); + // Cache the start value. + + int stop (void); + // Compute the elapsed time. + +private: + ACE_Time_Value *max_wait_time_; + // Maximum time we were willing to wait. + + ACE_Time_Value start_time_; + // Beginning of the start time. + + int stopped_; + // Keeps track of whether we've already been stopped. +}; + #if defined (__ACE_INLINE__) #include "ace/Time_Value.i" #endif /* __ACE_INLINE__ */ |