title
Graph Drawing Toolkit

An object-oriented C++ library for handling and drawing graphs

stopwatch.h

Go to the documentation of this file.
00001 
00003 #ifndef _STOPWATCH_H
00004 #define _STOPWATCH_H
00005 
00006 //#include "define.h"
00007 
00036 typedef enum {
00037   USER_TIME,
00038   SYSTEM_TIME,
00039   ABSOLUTE_TIME
00040 } time_type;
00041 
00042 
00043 
00044 class stopwatch {
00045 
00046  private:
00047 
00048   // ---------------
00049   // private members
00050   // ---------------
00051   
00052   time_type  _type;    // what do you want to measure? absolute time
00053                        // (SYSTEM_TIME) or the time you are using
00054                        // (USER_TIME)?
00055   long long int   _previous_clock_value;    // previous value of user time.
00056   long long int   _total_time_value;        // total user time.
00057   bool       _time_pause;              // stopwatch in pause
00058 
00059   // ---------------
00060   // private methods
00061   // ---------------
00062 
00067   long long int _take_the_clock();
00068  
00069   // --------------
00070   // public methods
00071   // --------------
00072 
00073  public:
00074 
00080   stopwatch(time_type = USER_TIME);
00081 
00086   void  start();
00087 
00091   void reset();
00092 
00096   double get();
00097 
00103   double pause(); 
00104   
00105 };
00106 
00107 #endif // _STOPWATCH_H
00108 

Generated on Thu Jan 10 14:48:02 2008 for GDToolkit GAPI by  doxygen 1.5.3