seems something wrong with the timing
This commit is contained in:
Chris Lu committed 2021-03-13 14:14:30 -08:00
1 parent 22ef015cff
commit 0059f4a201
16 files changed
+2712 -25

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
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
}