now1 := time.Now()
time.Sleep(18 * time.Microsecond)
now2 := time.Now()
fmt.Println(now2.Sub(now1))

---- output ----
30.938µs
33.749µs
26.979µs
26.146µs
25.52µs
25.209µs
27.292µs
25µs
150.52µs
28.021µs
27.656µs
25.52µs
146.77µs
27.709µs
25µs
142.447µs
149.843µs

标签: go

添加新评论