-
Notifications
You must be signed in to change notification settings - Fork 0
/
wtime.go
51 lines (38 loc) · 809 Bytes
/
wtime.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package wtime
import (
"time"
)
var defWheel *Wheel
func init() {
defWheel = NewWheel(500 * time.Millisecond)
}
func NewTimer(d time.Duration) *Timer {
return defWheel.NewTimer(d)
}
func NewStopedTimer() *Timer {
return defWheel.NewStopedTimer()
}
func Sleep(d time.Duration) {
defWheel.Sleep(d)
}
func After(d time.Duration) <-chan time.Time {
return defWheel.After(d)
}
func AfterFunc(d time.Duration, f func()) *Timer {
return defWheel.AfterFunc(d, f)
}
func NewTicker(d time.Duration) *Ticker {
return defWheel.NewTicker(d)
}
func Tick(d time.Duration) <-chan time.Time {
return defWheel.Tick(d)
}
func TickFunc(d time.Duration, f func()) *Ticker {
return defWheel.TickFunc(d, f)
}
func FNow() time.Time {
return defWheel.FNow()
}
func CNow() time.Time {
return defWheel.CNow()
}