summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-19 17:52:43 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-19 17:52:43 -0800
commita8f26243b483f85f87f4f46b8c3b4734aa2113a4 (patch)
tree81cadb6038dcf8e6db9c40b8121c5451d391cac1 /src
parent79603efef8fd84fea1d87784ca7538958d0dabd3 (diff)
Removed bench.h and timing calls in main.c
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/bench.h27
-rw-r--r--src/main.c9
3 files changed, 0 insertions, 37 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f3e9877..814591e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -9,7 +9,6 @@ set(HEADERS
iterator.h
chunk.h
references.h
- bench.h
utf8.h
scanners.h
inlines.h
diff --git a/src/bench.h b/src/bench.h
deleted file mode 100644
index 744dea3..0000000
--- a/src/bench.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef CMARK_BENCH_H
-#define CMARK_BENCH_H
-
-#include <stdio.h>
-#include <time.h>
-
-#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) %4.f ns " M "\n", __FILE__, __LINE__, \
- (_cmark_end_time - _cmark_start_time) * 1000000); \
- _cmark_start_time = _cmark_save_time;
-
-#else
-#define start_timer()
-#define end_timer(M)
-#endif
-
-#endif
diff --git a/src/main.c b/src/main.c
index 239d793..f9fa29c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4,7 +4,6 @@
#include <errno.h>
#include "config.h"
#include "cmark.h"
-#include "bench.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <io.h>
@@ -153,14 +152,12 @@ int main(int argc, char *argv[]) {
exit(1);
}
- start_timer();
while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) {
cmark_parser_feed(parser, buffer, bytes);
if (bytes < sizeof(buffer)) {
break;
}
}
- end_timer("processing lines");
fclose(fp);
}
@@ -175,18 +172,12 @@ int main(int argc, char *argv[]) {
}
}
- start_timer();
document = cmark_parser_finish(parser);
- end_timer("finishing document");
cmark_parser_free(parser);
- start_timer();
print_document(document, writer, options, width);
- end_timer("print_document");
- start_timer();
cmark_node_free(document);
- end_timer("free_blocks");
free(files);