2
* libcaca Colour ASCII-Art library
3
* Copyright (c) 2009 Sam Hocevar <sam@hocevar.net>
6
* This library is free software. It comes without any warranty, to
7
* the extent permitted by applicable law. You can redistribute it
8
* and/or modify it under the terms of the Do What The Fuck You Want
9
* To Public License, Version 2, as published by Sam Hocevar. See
10
* http://sam.zoy.org/wtfpl/COPYING for more details.
14
* This file contains profiling functions.
17
#ifndef __CACA_PROF_H__
18
#define __CACA_PROF_H__
20
#if defined PROF && !defined __KERNEL__
21
# define PROFILING_VARS
23
# define STAT_IADD(_s, _n) \
26
struct caca_stat *s = _s; \
28
for (i = STAT_VALUES - 1; i > 0; i--) \
29
s->itable[i] = s->itable[i - 1]; \
31
s->imean = (s->imean * 63 + (int64_t)n * 64 + 32) / 64; \
35
# define START_PROF(obj, fn)
36
# define STOP_PROF(obj, fn)
39
# define PROFILING_VARS
40
# define STAT_IADD(_s, _n) do { } while(0)
41
# define START_PROF(obj, fn) do { } while(0)
42
# define STOP_PROF(obj, fn) do { } while(0)
45
#endif /* __CACA_PROF_H__ */