Documentation ¶
Overview ¶
时间管理
Index ¶
- func Date() string
- func Datetime() string
- func Format(format string, timestamps ...int64) string
- func Microsecond() int64
- func Millisecond() int64
- func Nanosecond() int64
- func Second() int64
- func SetInterval(t time.Duration, callback func() bool)
- func SetTimeout(t time.Duration, callback func())
- func StrToTime(str string, format ...string) (time.Time, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInterval ¶
类似与js中的SetInterval,每隔一段时间后执行回调函数,当回调函数返回true,那么继续执行,否则终止执行,该方法是异步的 注意:由于采用的是循环而不是递归操作,因此间隔时间将会以上一次回调函数执行完成的时间来计算
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.