| 37 | #include "error.h" |
| 38 | |
| 39 | int64_t av_gettime(void) |
| 40 | { |
| 41 | #if HAVE_GETTIMEOFDAY |
| 42 | struct timeval tv; |
| 43 | gettimeofday(&tv, NULL); |
| 44 | return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; |
| 45 | #elif HAVE_GETSYSTEMTIMEASFILETIME |
| 46 | FILETIME ft; |
| 47 | int64_t t; |
| 48 | GetSystemTimeAsFileTime(&ft); |
| 49 | t = (int64_t)ft.dwHighDateTime << 32 | ft.dwLowDateTime; |
| 50 | return t / 10 - 11644473600000000; /* Jan 1, 1601 */ |
| 51 | #else |
| 52 | return -1; |
| 53 | #endif |
| 54 | } |
| 55 | |
| 56 | int64_t av_gettime_relative(void) |
| 57 | { |
no outgoing calls