Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock interface {
// Now NewTimer ...
//
// 标准库中的操作集合, stdClock和mockClock都有对应的实现
//
Now() time.Time
NewTimer(d time.Duration) *Timer
Sleep(d time.Duration)
// Add Set ...
//
// mockClock使用以下这些函数来修改当前时间
// 注意,如果是stdClock,则没有必要调用以下函数(调用以下函数为空实现)
//
Add(d time.Duration)
Set(t time.Time)
}
func NewFakeClock ¶
func NewFakeClock() Clock
func NewStdClock ¶
func NewStdClock() Clock
Click to show internal directories.
Click to hide internal directories.