From 09d91fd00134c50a476c9388bf47399d13996cb1 Mon Sep 17 00:00:00 2001 From: Eoghan Conlon Date: Fri, 23 Aug 2024 12:18:06 +0100 Subject: [PATCH 1/3] Changed to day 1 sample file for testing timer Signed-off-by: Eoghan Conlon --- src/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.go b/src/main.go index 30f9cb1..189dbf5 100644 --- a/src/main.go +++ b/src/main.go @@ -3,7 +3,7 @@ package main import "fmt" func main() { - input := FileParse("input/test.txt") + input := FileParse("input/day01/sample.txt") for _, s := range input { fmt.Println(s) } -- 2.46.1 From e771a65910eacde7dd8e743fa8326ca11b490361 Mon Sep 17 00:00:00 2001 From: Eoghan Conlon Date: Fri, 23 Aug 2024 12:22:09 +0100 Subject: [PATCH 2/3] Complete program timer implemented Signed-off-by: Eoghan Conlon --- src/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.go b/src/main.go index 189dbf5..11f5713 100644 --- a/src/main.go +++ b/src/main.go @@ -1,10 +1,15 @@ package main -import "fmt" +import ( + "fmt" + "time" +) func main() { + start := time.Now() input := FileParse("input/day01/sample.txt") for _, s := range input { fmt.Println(s) } + fmt.Printf("This took %v to run", time.Since(start)) } -- 2.46.1 From 110e53f06345ef153e28f34ac6c0ea806086f45a Mon Sep 17 00:00:00 2001 From: Eoghan Conlon Date: Fri, 23 Aug 2024 12:26:30 +0100 Subject: [PATCH 3/3] Day 1 timeing implemented Signed-off-by: Eoghan Conlon --- src/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.go b/src/main.go index 11f5713..f35220a 100644 --- a/src/main.go +++ b/src/main.go @@ -7,9 +7,14 @@ import ( func main() { start := time.Now() - input := FileParse("input/day01/sample.txt") - for _, s := range input { + fmt.Println("Day 1.....") + D1_start := time.Now() + sample_input := FileParse("input/day01/sample.txt") + fmt.Printf("Input parsing (%v).....\n", time.Since(D1_start)) + for _, s := range sample_input { fmt.Println(s) } + fmt.Printf("Day 1 took %v to run\n", time.Since(D1_start)) + fmt.Println("End of AoC code") fmt.Printf("This took %v to run", time.Since(start)) } -- 2.46.1