Documentation
¶
Index ¶
- type ChainTime
- type TimeStamp
- func (ts TimeStamp) AddMilliSeconds(milliSec int64) TimeStamp
- func (ts TimeStamp) AddSeconds(sec int64) TimeStamp
- func (ts TimeStamp) After(t TimeStamp) bool
- func (ts TimeStamp) Bytes() []byte
- func (ts TimeStamp) Local() time.Time
- func (ts TimeStamp) SinceMilliSeconds(t TimeStamp) int64
- func (ts TimeStamp) SinceSeconds(t TimeStamp) int64
- func (ts TimeStamp) String() string
- func (ts TimeStamp) UTC() time.Time
- func (ts TimeStamp) Unix() int64
- func (ts TimeStamp) UnixMilli() int64
- type TimerFunc
- type TimerManager
- type TimerStatus
- type TimerType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainTime ¶
type ChainTime interface {
Now() TimeStamp
SinceSeconds(t TimeStamp) int64
// NowAfter checks if current timestamp greater than the given one
NowAfter(t TimeStamp) bool
}
func GetChainTime ¶
type TimeStamp ¶
type TimeStamp int64
func TimeToTimeStamp ¶
func (TimeStamp) AddMilliSeconds ¶
func (TimeStamp) AddSeconds ¶
func (TimeStamp) SinceMilliSeconds ¶
func (TimeStamp) SinceSeconds ¶
type TimerManager ¶
type TimerManager interface {
RegisterPeriodicTimer(name string, routine TimerFunc, interval uint32)
RegisterOneTimeRoutine(name string, routine TimerFunc, delay uint32)
RemoveTimer(name string)
ClearTimers()
StartTimer(name string, triggerNextTicker bool)
StartAndTriggerTimer(name string)
StopTimer(name string)
}
func NewTimerManager ¶
func NewTimerManager(id string) TimerManager
type TimerStatus ¶
type TimerStatus int32
const ( TimerStatus_Unknown TimerStatus = iota TimerStatus_Stopped TimerStatus_Running )
Click to show internal directories.
Click to hide internal directories.