Time Elapsed
Python
- import time
- t0 = time.time()
- time.sleep(3.5) # for example
- t1 = time.time()
- print "Took %.2f seconds" % (t1 - t0)
Go
- package main
- import "time"
- func main() {
- t0 := time.Now()
- elapsed := time.Since(t0)
- fmt.Printf("Took %s", elapsed)
- }