Go to the documentation of this file.
26 #ifndef AVUTIL_TIMER_H
27 #define AVUTIL_TIMER_H
35 #if HAVE_MACH_MACH_TIME_H
36 #include <mach/mach_time.h>
51 #if !defined(AV_READ_TIME)
53 # define AV_READ_TIME gethrtime
54 # elif HAVE_MACH_ABSOLUTE_TIME
55 # define AV_READ_TIME mach_absolute_time
62 uint64_t tstart = AV_READ_TIME(); \
64 #define STOP_TIMER(id) \
65 tend = AV_READ_TIME(); \
67 static uint64_t tsum = 0; \
68 static int tcount = 0; \
69 static int tskip_count = 0; \
71 tend - tstart < 8 * tsum / tcount || \
72 tend - tstart < 2000) { \
73 tsum+= tend - tstart; \
77 if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
78 av_log(NULL, AV_LOG_ERROR, \
79 "%"PRIu64" UNITS in %s, %d runs, %d skips\n", \
80 tsum * 10 / tcount, id, tcount, tskip_count); \
85 #define STOP_TIMER(id) { }