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();
00015
00016
00017
00018 int64_t get_difference(struct timeval *result);
00019 int64_t get_difference();
00020
00021
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