Expose time stats

This commit is contained in:
Krzosa Karol
2023-01-01 19:59:27 +01:00
parent aa994c999a
commit 1121e4aa84
4 changed files with 28 additions and 26 deletions

View File

@@ -273,7 +273,7 @@ static void compile_file(Allocator *allocator, String filename, U32 compile_flag
B32 r = os_write_file("program.c"_s, result);
assert(r);
F64 total_compiler_time = os_time() - pctx->total_time;
F64 total_compiler_time = os_time() - pctx->time.start;
printf("%f - ", total_compiler_time);
Scratch_Arena *scratch = pctx->scratch;
@@ -291,11 +291,12 @@ static void compile_file(Allocator *allocator, String filename, U32 compile_flag
F64 end = os_time();
if (is_flag_set(compile_flags, COMPILE_PRINT_STATS)) {
printf("total = %f\n", os_time() - pctx->total_time);
printf("clang = %f\n", end - begin);
printf("parsing = %f\n", pctx->parsing_time_end - pctx->parsing_time_begin);
printf("resolving = %f\n", pctx->resolving_time_end - pctx->resolving_time_begin);
printf("generatin = %f\n", pctx->generating_time_end - pctx->generating_time_begin);
printf("total = %f\n", os_time() - pctx->time.start);
printf("core_total = %f\n", pctx->time.total);
printf("clang = %f\n", end - begin);
printf("parsing = %f\n", pctx->time.parsing);
printf("typecheck = %f\n", pctx->time.typechecking);
printf("generatin = %f\n", pctx->time.code_generation);
}
if (is_flag_set(compile_flags, COMPILE_PRINT_ALLOCATOR_STATS_BEFORE_DESTROY)) {