You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
306 B
18 lines
306 B
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
|
|
}
|