00001
00002
00003
00004
00005
00006
00007 #ifndef INCLUDE__EGMEASURE_H__FILE
00008 #define INCLUDE__EGMEASURE_H__FILE
00009
00010 #include <sys/times.h>
00011 #include <time.h>
00012 #include <sys/time.h>
00013 #include <iosfwd>
00014
00018 class EGMeasure {
00019 public:
00020 EGMeasure();
00021
00022 void Start(std::ostream&);
00023 void Lap(std::ostream&);
00024 void Stop(std::ostream&);
00025
00026 private:
00027 const long clocks_per_second;
00028 const unsigned output_precision;
00029
00030
00031 struct tms tms_start, tms_stop, tms_prev;
00032
00033 struct timeval timeval_start, timeval_stop, timeval_prev;
00034 struct timezone tzone;
00035
00036 void DisplayDiff(std::ostream&, tms, tms, timeval, timeval);
00037 void DisplayS(std::ostream&, double);
00038 };
00039
00040 #endif //INCLUDE__EGMEASURE_H__FILE
00041