1 #ifndef COUNTER_H 2 #define COUNTER_H 3 4 namespace cdo 5 { 6 class Counter 7 { 8 public: Counter()9 Counter() : m_cputime(0) {} 10 11 void start(); 12 void stop(); 13 double cputime()14 cputime() 15 { 16 return m_cputime; 17 } 18 19 private: 20 double m_cputime = 0; 21 char mark[32] = { 0 }; 22 }; 23 } // namespace cdo 24 25 #endif /* COUNTER_H */ 26