stime

package
v1.4.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2021 License: BSD-3-Clause Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Since2014 int64 = time.Date(2014, 1, 1, 0, 0, 0, 0, time.UTC).UnixNano() / 1000
)

Functions

func DayBeginStamp

func DayBeginStamp(now int64) int64

func DayBeginStampFromStr

func DayBeginStampFromStr(day string) (int64, error)

获取指定天的时间范围 天格式 2006-01-02 为空时候返回当天的

func HourBeginStamp

func HourBeginStamp(now int64) int64

func MonthScope

func MonthScope(stamp int64) (int64, int64)

func NewTimeStat

func NewTimeStat() *runTimeStat

func NewTimeStat(key string) *runTimeStat {

func Timestamp2014

func Timestamp2014() uint64

func WeekScope

func WeekScope(stamp int64) (int64, int64)

Types

type BackOffCtrl

type BackOffCtrl struct {
	// contains filtered or unexported fields
}

func NewBackOffCtrl

func NewBackOffCtrl(step time.Duration, ceil time.Duration) *BackOffCtrl

func (*BackOffCtrl) BackOff

func (m *BackOffCtrl) BackOff()

执行退避,会发生阻塞

func (*BackOffCtrl) Reset

func (m *BackOffCtrl) Reset()

终止退避过程,reset退避状态

func (*BackOffCtrl) SetCtrl

func (m *BackOffCtrl) SetCtrl(step time.Duration, ceil time.Duration)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL