Sleeping in Golang
Sleeping in Go and how to pause execution and sleep for a number of seconds in Go (golang). We can use the time package from the standard library to sleep for a duration of time. You can use any duration of time, providing you use the constants provided.
In our example below we sleep for two seconds, and to illustrate the point, we print out the time before and after we do this.