aboutsummaryrefslogtreecommitdiffstats
path: root/src/meh.h
diff options
context:
space:
mode:
authorJohn Hawthorn <jhawthor@uvic.ca>2009-01-03 18:11:05 -0800
committerJohn Hawthorn <jhawthor@uvic.ca>2009-01-03 18:11:05 -0800
commitb380f19efc5bad5d3a5eae3ae799ab1c9a687704 (patch)
tree0b412804a81df61b1a225768d33284e162f35650 /src/meh.h
parentfedf5595b3777cd05bf3ff812eae26973ffddaa4 (diff)
downloadmirror-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.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/meh.h b/src/meh.h
index d7f160e..bec6724 100644
--- a/src/meh.h
+++ b/src/meh.h
@@ -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
+