mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
0059f4a201
seems something wrong with the timing
19 lines
306 B
Go
19 lines
306 B
Go
package udptransfer
|
|
|
|
import "time"
|
|
|
|
const Millisecond = 1e6
|
|
|
|
func Now() int64 {
|
|
return time.Now().UnixNano()/Millisecond
|
|
}
|
|
|
|
func NowNS() int64 {
|
|
return time.Now().UnixNano()
|
|
}
|
|
|
|
func NewTimerChan(d int64) <-chan time.Time {
|
|
ticker := time.NewTimer(time.Duration(d) * time.Millisecond)
|
|
return ticker.C
|
|
}
|