r1009: Move the dependencies to newer package names
[cinelerra_cv/mob.git] / guicast / bctimer.h
blobdd38647c7b6864383192e419f5fccf2fc03e5bd5
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 // set last update to now
15 int update();
17 // get difference between now and last update in milliseconds
18 // must be positive or error results
19 int64_t get_difference(struct timeval *result); // also stores in timeval
20 int64_t get_difference();
22 // get difference in arbitrary units between now and last update
23 int64_t get_scaled_difference(long denominator);
24 static int delay(long milliseconds);
26 private:
27 struct timeval current_time;
28 struct timeval new_time;
29 struct timeval delay_duration;
34 #endif