aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-11 15:59:43 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-11 15:59:43 +0330
commitfe81eba1c232ab99bcfedf9546a82b06c796b086 (patch)
tree1ddf9d17f14a69c9cbe93cdbb1ef557f812c79d7 /src/main.c
parent1a50974b834227190f7de3939db5689bb0702a34 (diff)
some clean ups
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index 1e04d0b..2906c2d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -10,20 +10,20 @@
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);
+ Time start, end;
+ Time lexTime = {0};
+ Time parseTime = {0};
+ Time astTime;
+ Time runTime;
+ Time totalTime = {0};
+ start = get_time();
#endif
AstTreeRoots astTrees = makeAstTree(filePath, &lexTime, &parseTime);
if (astTrees.size == AST_TREE_ROOTS_ERROR.size) {
return 1;
}
#ifdef PRINT_STATISTICS
- clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end);
+ end = get_time();
astTime = time_diff(end, start);
totalTime = time_add(totalTime, astTime);
#endif
@@ -33,7 +33,7 @@ static int run(const char *filePath) {
}
#endif
#ifdef PRINT_STATISTICS
- clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start);
+ start =get_time();
#endif
int ret;
@@ -44,7 +44,7 @@ static int run(const char *filePath) {
}
astTreeRootsDestroy(astTrees);
#ifdef PRINT_STATISTICS
- clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end);
+ end = get_time();
runTime = time_diff(end, start);
totalTime = time_add(totalTime, runTime);
#endif