mirror of
https://github.com/golang/go
synced 2024-11-19 02:34:44 -07:00
18 lines
263 B
Go
18 lines
263 B
Go
|
// +build ignore
|
||
|
|
||
|
package B1
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
var startup = time.Now()
|
||
|
|
||
|
func example() time.Duration {
|
||
|
before := time.Now()
|
||
|
time.Sleep(1)
|
||
|
return time.Now().Sub(before)
|
||
|
}
|
||
|
|
||
|
func msSinceStartup() int64 {
|
||
|
return int64(time.Now().Sub(startup) / time.Millisecond)
|
||
|
}
|