Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

timer.h

Go to the documentation of this file.
00001 
00006 #ifndef TIMER_H
00007 #define TIMER_H
00008 
00009 #ifndef WIN32
00010 # include <sys/time.h>
00011 # include <time.h>
00012 #else
00013 #include "common.h"
00014 #endif
00015 
00017 class Timer
00018 {
00019 public:
00021   Timer (void);
00022 
00026   double Delta (void);
00027 
00030   void Pause (void) { paused = true; }
00036   void Unpause (void) { paused = false; }
00039   void SetSpeed (double s) { speed = s; }
00040 
00041 private:
00042   /* speed control */
00043   bool paused;
00044   double speed;
00045 
00046   /* win32-specific data */
00047 #ifdef WIN32
00048   /* for performance counter */
00049   __int64 pc_time;
00050   /* for timeGetTime */
00051   uint gt_time;
00052 #else
00053   struct timeval timeval;
00054 #endif
00055 };
00056 
00057 #endif

Generated on Fri Jan 12 14:15:02 2007 for Construct by  doxygen 1.4.3-20050530