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

bctimer.h

Go to the documentation of this file.
00001 #ifndef BCTIMER_H
00002 #define BCTIMER_H
00003 
00004 #include <stdint.h>
00005 #include <sys/time.h>
00006 
00007 
00008 class Timer
00009 {
00010 public:
00011         Timer();
00012         virtual ~Timer();
00013         
00014         int update();                // set last update to now
00015         
00016 // get difference between now and last update in milliseconds
00017 // must be positive or error results
00018         int64_t get_difference(struct timeval *result); // also stores in timeval
00019         int64_t get_difference();
00020 
00021 // get difference in arbitrary units between now and last update    
00022         int64_t get_scaled_difference(long denominator);        
00023         static int delay(long milliseconds);
00024 
00025 private:
00026         struct timeval current_time;
00027         struct timeval new_time;
00028         struct timeval delay_duration;
00029 };
00030 
00031 
00032 
00033 #endif

Generated on Sun Jan 8 13:26:33 2006 for Guicast-svn by  doxygen 1.4.4