r801: Check for Freetype 2.
[cinelerra_cv/ct.git] / guicast / bctimer.h
blob9b4e541e900e0a49f014fd7eac87b16c7f522865
1 #ifndef BCTIMER_H
2 #define BCTIMER_H
4 #include <stdint.h>
5 #include <sys/time.h>
8 class Timer
10 public:
11 Timer();
12 virtual ~Timer();
14 int update(); // set last update to now
16 // get difference between now and last update in milliseconds
17 // must be positive or error results
18 int64_t get_difference(struct timeval *result); // also stores in timeval
19 int64_t get_difference();
21 // get difference in arbitrary units between now and last update
22 int64_t get_scaled_difference(long denominator);
23 static int delay(long milliseconds);
25 private:
26 struct timeval current_time;
27 struct timeval new_time;
28 struct timeval delay_duration;
33 #endif