Go to the documentation of this file.
26 #ifndef AVUTIL_TIMER_H
27 #define AVUTIL_TIMER_H
45 #if !defined(AV_READ_TIME) && HAVE_GETHRTIME
46 # define AV_READ_TIME gethrtime
52 uint64_t tstart = AV_READ_TIME(); \
54 #define STOP_TIMER(id) \
55 tend = AV_READ_TIME(); \
57 static uint64_t tsum = 0; \
58 static int tcount = 0; \
59 static int tskip_count = 0; \
61 tend - tstart < 8 * tsum / tcount || \
62 tend - tstart < 2000) { \
63 tsum+= tend - tstart; \
67 if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
68 av_log(NULL, AV_LOG_ERROR, \
69 "%"PRIu64" decicycles in %s, %d runs, %d skips\n", \
70 tsum * 10 / tcount, id, tcount, tskip_count); \
75 #define STOP_TIMER(id) { }