Can anybody help me by answering how to get system time in GO. For example, in the below code, I want to know when the first print and second print statements are executed and what is the time difference between them.
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
fmt.Println("Hello, 世界")
}
See the
timepackage. Documentation can be found at http://golang.org/pkg/time/For getting the nanoseconds-time before, after the first and after the last of your statements, and then printing them out:
In my VM, I then get the following results: