00001 00030 #ifndef TIMING_H 00031 #define TIMING_H 00032 00033 00034 namespace itpp { 00035 00044 class Timer { 00045 public: 00047 Timer(); 00049 virtual ~Timer() { } 00051 void start(void); 00053 double stop(void); 00055 void reset(double t=0.0); 00057 void tic(void); 00059 double toc(void); 00061 void toc_print(void); 00063 double get_time() const; 00064 00065 protected: 00067 virtual double get_current_time() const = 0; 00069 double start_time; 00071 double stop_time; 00073 double elapsed_time; 00075 bool running; 00076 }; 00077 00102 class CPU_Timer : public Timer { 00103 public: 00105 CPU_Timer() { } 00106 00107 protected: 00109 double get_current_time() const; 00110 }; 00111 00135 class Real_Timer : public Timer { 00136 public: 00138 Real_Timer() { } 00139 00140 protected: 00142 double get_current_time() const; 00143 }; 00144 00149 void tic(); 00150 00155 double toc(); 00156 00161 void toc_print(); 00162 00171 void pause(double t=-1); 00172 00173 } // namespace itpp 00174 00175 #endif // #ifndef TIMING_H
Generated on Sun Dec 9 17:26:17 2007 for IT++ by Doxygen 1.5.4