HomeNotesHow to measure execution time in Golang?How to measure execution time in Golang?2022-05-25⋅0 minutes readWhile developing Giraffe, I want to measure the execution time of the static files building process. Here is the example code using time package: start := time.Now() // build process... duration := time.Since(start) fmt.Println("Duration:", duration) or start := time.Now() // build process... end := time.Now() fmt.Println("Duration:", end.Sub(start)) Demo