Ignore:
Timestamp:
Dec 6, 2009, 10:21:40 PM (10 years ago)
Author:
Sam Hocevar
Message:

Gather profiling information in caca_refresh_display() and caca_get_event().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca_prof.h

    r3905 r4094  
    2121#if defined PROF && !defined __KERNEL__
    2222#   define PROFILING_VARS
     23
     24#   define STAT_IADD(s, n) \
     25      do \
     26      { \
     27        struct caca_stat *ss = s; \
     28        int ii, nn = n; \
     29        for (ii = STAT_VALUES - 1; ii > 0; ii--) \
     30            ss->itable[ii] = ss->itable[ii - 1]; \
     31        ss->itable[0] = nn; \
     32        ss->imean = ((int64_t)ss->imean * 15 + nn) / 16; \
     33      } \
     34      while(0)
     35
    2336#   define START_PROF(obj, fn)
    2437#   define STOP_PROF(obj, fn)
     
    2639#else
    2740#   define PROFILING_VARS
     41#   define STAT_IADD(s) do { } while(0)
    2842#   define START_PROF(obj, fn) do { } while(0)
    2943#   define STOP_PROF(obj, fn) do { } while(0)
Note: See TracChangeset for help on using the changeset viewer.