summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 273f4ec..1e04d0b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -11,12 +11,14 @@
static int run(const char *filePath) {
#ifdef PRINT_STATISTICS
struct timespec start, end;
+ struct timespec lexTime = {0};
+ struct timespec parseTime = {0};
struct timespec astTime;
struct timespec runTime;
struct timespec totalTime = {0};
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start);
#endif
- AstTreeRoots astTrees = makeAstTree(filePath);
+ AstTreeRoots astTrees = makeAstTree(filePath, &lexTime, &parseTime);
if (astTrees.size == AST_TREE_ROOTS_ERROR.size) {
return 1;
}
@@ -48,6 +50,12 @@ static int run(const char *filePath) {
#endif
#ifdef PRINT_STATISTICS
+ astTime = time_diff(astTime, parseTime);
+ parseTime = time_diff(parseTime, lexTime);
+ printf("\nlexTime: ");
+ time_print(lexTime);
+ printf("\nparseTime: ");
+ time_print(parseTime);
printf("\nastTime: ");
time_print(astTime);
printf("\nrunTime: ");