golang

Golang Measuring Running Time

When coding in any language, more often than not, you might be interested to see how long a particular function or whole program takes to execute. This can be done in one of the two ways in for a Go program To see how long a program takes: time go run src/main.go Not specific to GO but this easier measure any cli command. To see how long a particular snippet takes: func main() { startedAt := time.