IT++ Logo
timing.h
Go to the documentation of this file.
1 
29 #ifndef TIMING_H
30 #define TIMING_H
31 
32 #include <itpp/itexports.h>
33 
34 namespace itpp
35 {
36 
45 class ITPP_EXPORT Timer
46 {
47 public:
49  Timer();
51  virtual ~Timer() { }
53  void start(void);
55  double stop(void);
57  void reset(double t = 0.0);
59  void tic(void);
61  double toc(void);
63  void toc_print(void);
65  double get_time() const;
66 
67 protected:
69  virtual double get_current_time() const = 0;
71  double start_time;
73  double stop_time;
75  double elapsed_time;
77  bool running;
78 };
79 
104 class ITPP_EXPORT CPU_Timer : public Timer
105 {
106 public:
108  CPU_Timer() { }
109 
110 protected:
112  double get_current_time() const;
113 };
114 
138 class ITPP_EXPORT Real_Timer : public Timer
139 {
140 public:
143 
144 protected:
146  double get_current_time() const;
147 };
148 
153 ITPP_EXPORT void tic();
154 
159 ITPP_EXPORT double toc();
160 
165 ITPP_EXPORT void toc_print();
166 
175 ITPP_EXPORT void pause(double t = -1);
176 
177 } // namespace itpp
178 
179 #endif // #ifndef TIMING_H
SourceForge Logo

Generated on Sat May 25 2013 16:32:20 for IT++ by Doxygen 1.8.2