mirror of
https://github.com/golang/go
synced 2024-11-18 09:04:49 -07:00
bfcffc697d
See refactor/eg/eg.go for details. LGTM=crawshaw R=crawshaw, gri, kamil.kisiel, josharian CC=golang-codereviews https://golang.org/cl/81010043
18 lines
255 B
Plaintext
18 lines
255 B
Plaintext
// +build ignore
|
|
|
|
package B1
|
|
|
|
import "time"
|
|
|
|
var startup = time.Now()
|
|
|
|
func example() time.Duration {
|
|
before := time.Now()
|
|
time.Sleep(1)
|
|
return time.Since(before)
|
|
}
|
|
|
|
func msSinceStartup() int64 {
|
|
return int64(time.Since(startup) / time.Millisecond)
|
|
}
|