emacs vars for .inc files
[cinelerra_cv/mob.git] / guicast / bctimer.h
blobe1b5bd9af0831bc895b5ee73750b4cdc39f045ee
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
36 // Local Variables:
37 // mode: C++
38 // c-file-style: "linux"
39 // End: