IT++ Logo
timing.h
Go to the documentation of this file.
00001 
00029 #ifndef TIMING_H
00030 #define TIMING_H
00031 
00032 
00033 namespace itpp
00034 {
00035 
00044 class Timer
00045 {
00046 public:
00048   Timer();
00050   virtual ~Timer() { }
00052   void start(void);
00054   double stop(void);
00056   void reset(double t = 0.0);
00058   void tic(void);
00060   double toc(void);
00062   void toc_print(void);
00064   double get_time() const;
00065 
00066 protected:
00068   virtual double get_current_time() const = 0;
00070   double start_time;
00072   double stop_time;
00074   double elapsed_time;
00076   bool running;
00077 };
00078 
00103 class CPU_Timer : public Timer
00104 {
00105 public:
00107   CPU_Timer() { }
00108 
00109 protected:
00111   double get_current_time() const;
00112 };
00113 
00137 class Real_Timer : public Timer
00138 {
00139 public:
00141   Real_Timer() { }
00142 
00143 protected:
00145   double get_current_time() const;
00146 };
00147 
00152 void tic();
00153 
00158 double toc();
00159 
00164 void toc_print();
00165 
00174 void pause(double t = -1);
00175 
00176 } // namespace itpp
00177 
00178 #endif // #ifndef TIMING_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SourceForge Logo

Generated on Sat Jul 9 2011 15:21:30 for IT++ by Doxygen 1.7.4