00001 00024 #ifndef GALOIS_TIMER_H 00025 #define GALOIS_TIMER_H 00026 00027 namespace Galois { 00028 00030 class Timer { 00031 //This is so that implementations can vary without 00032 //forcing includes of target specific headers 00033 unsigned long _start_hi; 00034 unsigned long _start_low; 00035 unsigned long _stop_hi; 00036 unsigned long _stop_low; 00037 public: 00038 Timer(); 00039 void start(); 00040 void stop(); 00041 unsigned long get() const; 00042 unsigned long get_usec() const; 00043 }; 00044 00047 class TimeAccumulator { 00048 Timer ltimer; 00049 unsigned long acc; 00050 public: 00051 TimeAccumulator(); 00052 void start(); 00054 void stop(); 00055 unsigned long get() const; 00056 TimeAccumulator& operator+=(const TimeAccumulator& rhs); 00057 }; 00058 } 00059 #endif 00060