File: tc.h

package info (click to toggle)
python-numarray 1.1.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,428 kB
  • ctags: 8,469
  • sloc: ansic: 92,018; python: 20,861; makefile: 263; sh: 13
file content (36 lines) | stat: -rw-r--r-- 1,295 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#if defined(MEASURE_TIMING)

/* ----------------------------------------------------------------------- */

typedef struct 
{
	PyObject_HEAD
	unsigned long   start_count;       /* Total count of starts */
	unsigned long   start;             /* Last start time in usec */
	unsigned long   stop;              /* Last stop time in usec */
	double          accum;             /* Accumulated timing in usec for all start/stop cycles */
	unsigned long   entries;           /* Incrementing/Decrementing count of starts */
	unsigned long   starts_on_entry;   /* global start count at top level entry */
	unsigned long   cycles;            /* Last count of nested teacup cycles (overhead) */
} PyTeaCupObject;

/* ----------------------------------------------------------------------- */

#include "libteacup.h"

/* ----------------------------------------------------------------------- */

#define tc_start_clock(x) { static void *cache; cache = _teacup_start_clock(__FILE__, x, cache); }
#define tc_stop_clock(x)  { static void *cache; cache = _teacup_stop_clock(__FILE__, x, cache); }
#define import_libtc()  import_libteacup()

/* ----------------------------------------------------------------------- */

#else 

#define tc_start_clock(x)
#define tc_stop_clock(x)
#define import_libtc()

#endif