# HG changeset patch # User alpar # Date 1077557630 0 # Node ID 8d24100ad4085df2eb4b7088d5daf64fbce2c91d # Parent 2d1da2e1644a0f7b418e0b2fa75c1c455602154d . diff -r 2d1da2e1644a -r 8d24100ad408 src/work/marci/time_measure.h --- a/src/work/marci/time_measure.h Mon Feb 23 16:38:49 2004 +0000 +++ b/src/work/marci/time_measure.h Mon Feb 23 17:33:50 2004 +0000 @@ -76,23 +76,19 @@ double getUserTime() const { - long cls = sysconf(_SC_CLK_TCK); - return double(ts.tms_utime)/cls; + return double(ts.tms_utime)/sysconf(_SC_CLK_TCK); } double getSystemTime() const { - long cls = sysconf(_SC_CLK_TCK); - return double(ts.tms_stime)/cls; + return double(ts.tms_stime)/sysconf(_SC_CLK_TCK); } double getCUserTime() const { - long cls = sysconf(_SC_CLK_TCK); - return double(ts.tms_cutime)/cls; + return double(ts.tms_cutime)/sysconf(_SC_CLK_TCK); } double getCSystemTime() const { - long cls = sysconf(_SC_CLK_TCK); - return double(ts.tms_cstime)/cls; + return double(ts.tms_cstime)/sysconf(_SC_CLK_TCK); } }; @@ -100,16 +96,25 @@ { TimeStamp start_time; + void _reset() {start_time.stamp();} + public: - void reset() {start_time.stamp();} - Timer() {reset();} + Timer() {_reset();} operator TimeStamp () { TimeStamp t; t.stamp(); return t-start_time; - } + } + + TimeStamp reset() + { + TimeStamp t(start_time); + _reset(); + return start_time-t; + } + }; inline std::ostream& operator<<(std::ostream& os,const TimeStamp &t)