1 #ifndef _BLUE_STOP_WATCH_H 2 #define _BLUE_STOP_WATCH_H 3 4 #include <BeBuild.h> 5 #include <SupportDefs.h> 6 7 #ifdef USE_OPENBEOS_NAMESPACE 8 namespace OpenBeOS { 9 #endif 10 11 class BStopWatch { 12 public: 13 BStopWatch(const char *name, bool silent = false); 14 virtual ~BStopWatch(); 15 16 void Suspend(); 17 void Resume(); 18 bigtime_t Lap(); 19 bigtime_t ElapsedTime() const; 20 void Reset(); 21 const char *Name() const; 22 23 private: 24 virtual void _ReservedStopWatch1(); 25 virtual void _ReservedStopWatch2(); 26 27 bigtime_t fStart; 28 bigtime_t fSuspendTime; 29 bigtime_t fLaps[10]; 30 int32 fLap; 31 const char *fName; 32 uint32 _reserved[2]; // these are for fName to be initiased 33 bool fSilent; 34 }; 35 36 #ifdef USE_OPENBEOS_NAMESPACE 37 } // namespace OpenBeOS 38 using namespace OpenBeOS; 39 #endif 40 41 #endif /* _STOP_WATCH_H */ 42