diff --git a/day7/day7.go b/day7/day7.go index 2967b0d..5095693 100644 --- a/day7/day7.go +++ b/day7/day7.go @@ -17,6 +17,7 @@ type DirNode struct { func main() { args := os.Args[1:] lines := helper.ReadTextFile(args[0]) + defer helper.MeasureTime("Main")() root := DirNode{nil, 0, map[string]*DirNode{}} var currentNode *DirNode currentNode = &root diff --git a/helper/helper.go b/helper/helper.go index 846efbb..b53a710 100644 --- a/helper/helper.go +++ b/helper/helper.go @@ -39,7 +39,7 @@ func MeasureTime(process string) func() { fmt.Printf("Start %s\n", process) start := time.Now() return func() { - fmt.Printf("Time taken by %s is %v\n", process, time.Since(start)) + fmt.Printf("Time taken by %s is %v\n", process, time.Since(start).Nanoseconds()) } }