Day7 Time Measure

This commit is contained in:
Karl Spickermann 2022-12-07 18:47:24 +01:00
parent 81cbc8ac8c
commit 96c4f48dfe
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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())
}
}