diff options
Diffstat (limited to 'osdep/timer.h')
-rw-r--r-- | osdep/timer.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/osdep/timer.h b/osdep/timer.h index fe04663781..033b366750 100644 --- a/osdep/timer.h +++ b/osdep/timer.h @@ -19,10 +19,28 @@ #ifndef MPLAYER_TIMER_H #define MPLAYER_TIMER_H -void InitTimer(void); -unsigned int GetTimer(void); -unsigned int GetTimerMS(void); +#include <inttypes.h> +// Initialize timer, must be called at least once at start. +void mp_time_init(void); + +// Return time in microseconds. Never wraps. Never returns 0 or negative values. +int64_t mp_time_us(void); + +// Return time in seconds. Can have down to 1 microsecond resolution, but will +// be much worse when casted to float. +double mp_time_sec(void); + +// Provided by OS specific functions (timer-linux.c) +void mp_raw_time_init(void); +uint64_t mp_raw_time_us(void); + +// Sleep in microseconds. +void mp_sleep_us(int64_t us); + +// Legacy timer functions. These can wrap. +unsigned int GetTimer(void); // in us +unsigned int GetTimerMS(void); // in ms int usec_sleep(int usec_delay); #endif /* MPLAYER_TIMER_H */ |