Documentation
¶
Index ¶
- Variables
- func Author() string
- func License() string
- func Ms() int64
- func Now() time.Time
- func Ns() int64
- func S() int64
- func SetInterval(fn TimeCallback, timeout time.Duration) (chan interface{}, func())
- func SetTimeout(fn TimeCallback, timeout time.Duration) (chan interface{}, func())
- func Sleep(n int64)
- func StrToTime(s string, layout ...string) (int64, error)
- func String() string
- func TimeToStr(n int64, layout ...string) string
- func Us() int64
- func Usleep(n int64)
- func Version() string
- func WithTimeout(fn TimeCallback, timeout time.Duration) (chan interface{}, func())
- type TimeCallback
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCanceled = errors.New("xtime: canceled")
ErrCanceled is canceled error
View Source
var ErrTimeouted = errors.New("xtime: timeouted")
ErrTimeouted is timeouted error
Functions ¶
func SetInterval ¶
func SetInterval(fn TimeCallback, timeout time.Duration) (chan interface{}, func())
SetInterval execute the callback every timeout return a chan and cancel func
func SetTimeout ¶
func SetTimeout(fn TimeCallback, timeout time.Duration) (chan interface{}, func())
SetTimeout execute the callback after timeout return a chan and cancel func
func WithTimeout ¶
func WithTimeout(fn TimeCallback, timeout time.Duration) (chan interface{}, func())
WithTimeout execute the callback with timeout return a chan and cancel func
Types ¶
type TimeCallback ¶
type TimeCallback func() interface{}
TimeCallback is a callback with one return value
Click to show internal directories.
Click to hide internal directories.