diff options
author | John Hawthorn <jhawthor@uvic.ca> | 2009-01-03 18:11:05 -0800 |
---|---|---|
committer | John Hawthorn <jhawthor@uvic.ca> | 2009-01-03 18:11:05 -0800 |
commit | b380f19efc5bad5d3a5eae3ae799ab1c9a687704 (patch) | |
tree | 0b412804a81df61b1a225768d33284e162f35650 /src/meh.h | |
parent | fedf5595b3777cd05bf3ff812eae26973ffddaa4 (diff) | |
download | mirror-meh-b380f19efc5bad5d3a5eae3ae799ab1c9a687704.tar.gz mirror-meh-b380f19efc5bad5d3a5eae3ae799ab1c9a687704.tar.bz2 mirror-meh-b380f19efc5bad5d3a5eae3ae799ab1c9a687704.zip |
added macros to test timing
Diffstat (limited to 'src/meh.h')
-rw-r--r-- | src/meh.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -36,3 +36,16 @@ void xinit(); void drawimage(XImage *ximg, unsigned int width, unsigned int height); XImage *getimage(struct image *img, unsigned int width, unsigned int height); +#ifdef TDEBUG +#define TDEBUG_START \ +struct timeval t0;\ +struct timeval t1;\ +gettimeofday(&t0, NULL); +#define TDEBUG_END(x) \ +gettimeofday(&t1, NULL); \ +printf("%s: %li x100us\n", (x), ((t1.tv_sec - t0.tv_sec) * 1000000 + t1.tv_usec - t0.tv_usec) / 100); +#else +#define TDEBUG_START +#define TDEBUG_END(x) +#endif + |