diff --git a/src/main.odin b/src/main.odin index 4c6c629..ee727ba 100644 --- a/src/main.odin +++ b/src/main.odin @@ -2,6 +2,7 @@ package main import "core:fmt" import "core:os" +import "core:time" main :: proc() { handle: os.Handle @@ -33,7 +34,11 @@ main :: proc() { lexer := lexer_create(&u8_arr, file_name) parser := parser_create(lexer) + parser_time_start := time.now() ast := parser_parse(&parser) + parser_duration := time.since(parser_time_start) + defer fmt.printf("Parsing took: {}ns\n", time.duration_nanoseconds(parser_duration)) + if len(g_message_list) > 0 { contains_errors := false for &msg in g_message_list { @@ -47,7 +52,12 @@ main :: proc() { } } clear(&g_message_list) + + type_check_start := time.now() type_check(ast, nil) + type_check_duration := time.since(type_check_start) + defer fmt.printf("Type checker took: {}ns\n", time.duration_nanoseconds(type_check_duration)) + if len(g_message_list) > 0 { contains_errors := false for &msg in g_message_list {