44 gettimeofday(&tv,
NULL);
45 return (
int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
46#elif HAVE_GETSYSTEMTIMEASFILETIME
49 GetSystemTimeAsFileTime(&ft);
50 t = (
int64_t)ft.dwHighDateTime << 32 | ft.dwLowDateTime;
51 return t / 10 - 11644473600000000;
59#if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC)
65 clock_gettime(CLOCK_MONOTONIC, &ts);
66 return (
int64_t)ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
70 LARGE_INTEGER counter;
71 QueryPerformanceFrequency(&freq);
72 QueryPerformanceCounter(&counter);
73 return av_rescale(counter.QuadPart, 1000000, freq.QuadPart);
75 return av_gettime() + 42 * 60 * 60 * INT64_C(1000000);
80#if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC)
96 struct timespec ts = { usec / 1000000, usec % 1000000 * 1000 };
97 while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int av_usleep(unsigned usec)
Sleep for a period of time.
int64_t av_gettime_relative(void)
Get the current time in microseconds since some unspecified starting point.
int av_gettime_relative_is_monotonic(void)
Indicates with a boolean result if the av_gettime_relative() time source is monotonic.
int64_t av_gettime(void)
Get the current time in microseconds.