summaryrefslogtreecommitdiff
path: root/src/bench.h
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-11-13 11:17:08 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-11-13 11:17:08 -0800
commit5a8f1acf888c60463e7b418d55c1a5d26b3799f1 (patch)
tree21286ad596267444ed7eca2f036bc1cb295c44d9 /src/bench.h
parent5cbede7a725b8b72779a5a4bd38d49a2d01fc022 (diff)
Moved the timing macros to get finer-grained information.
Diffstat (limited to 'src/bench.h')
-rw-r--r--src/bench.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bench.h b/src/bench.h
index 7308197..fa4ae10 100644
--- a/src/bench.h
+++ b/src/bench.h
@@ -6,14 +6,17 @@
#ifdef TIMER
float _cmark_start_time;
float _cmark_end_time;
+float _cmark_save_time;
#define start_timer() \
+ _cmark_save_time = _cmark_start_time; \
_cmark_start_time = (float)clock()/CLOCKS_PER_SEC
#define end_timer(M) \
_cmark_end_time = (float)clock()/CLOCKS_PER_SEC; \
fprintf(stderr, "[TIME] (%s:%d) %8.f ns " M "\n", __FILE__, \
- __LINE__, (_cmark_end_time - _cmark_start_time) * 1000000)
+ __LINE__, (_cmark_end_time - _cmark_start_time) * 1000000); \
+ _cmark_start_time = _cmark_save_time;
#else
#define start_timer()