Changeset 327:63c138adc477 in lemon-0.x
- Timestamp:
- 04/15/04 08:49:49 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@445
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/time_measure.h
r324 r327 18 18 // } 19 19 20 /// Class to store (cpu)time instances. 21 22 /// This class stores five time values. 23 /// - a real time 24 /// - a user cpu time 25 /// - a system cpu time 26 /// - a user cpu time of children 27 /// - a system cpu time of children 28 /// 29 /// TimeStamp's can be added to or substracted from each other and 30 /// they can be push to a stream. 31 20 32 class TimeStamp 21 33 { … … 28 40 const tms &getTms() const {return ts;} 29 41 double getRealTime() const {return real_time;} 42 ///Read the current time values of the process. 30 43 void stamp() 31 44 { … … 35 48 } 36 49 50 /// Constructor initializing with zero. 37 51 TimeStamp() 38 52 { ts.tms_utime=ts.tms_stime=ts.tms_cutime=ts.tms_cstime=0; real_time=0;} 39 53 ///Constructor initializing with the current time values of the process. 40 54 TimeStamp(void *) { stamp();} 41 55 … … 69 83 } 70 84 85 ///The time ellapsed since the last call of stamp() 71 86 TimeStamp ellapsed() const 72 87 { … … 95 110 }; 96 111 112 ///Class measuring the cpu time and real time usage of the process. 97 113 class Timer 98 114 { … … 102 118 103 119 public: 120 ///Constructor. It starts with zero time counters. 104 121 Timer() {_reset();} 105 122 123 ///Computes the ellapsed time. 124 125 ///This conversion computes the ellapsed time 126 ///since the construction of \c t or since 127 ///the last \c t.reset(). 106 128 operator TimeStamp () 107 129 { … … 111 133 } 112 134 135 ///Resets the time counters. 113 136 TimeStamp reset() 114 137 { … … 119 142 }; 120 143 144 ///Prints the time counters. 121 145 inline std::ostream& operator<<(std::ostream& os,const TimeStamp &t) 122 146 {
Note: See TracChangeset
for help on using the changeset viewer.