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> 53 #if !defined(AV_READ_TIME) 55 # define AV_READ_TIME gethrtime 56 # elif HAVE_MACH_ABSOLUTE_TIME 57 # define AV_READ_TIME mach_absolute_time 64 uint64_t tstart = AV_READ_TIME(); \ 66 #define STOP_TIMER(id) \ 67 tend = AV_READ_TIME(); \ 69 static uint64_t tsum = 0; \ 70 static int tcount = 0; \ 71 static int tskip_count = 0; \ 73 tend - tstart < 8 * tsum / tcount || \ 74 tend - tstart < 2000) { \ 75 tsum+= tend - tstart; \ 79 if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \ 80 av_log(NULL, AV_LOG_ERROR, \ 81 "%"PRIu64" UNITS in %s, %d runs, %d skips\n", \ 82 tsum * 10 / tcount, id, tcount, tskip_count); \ 87 #define STOP_TIMER(id) { }