timer

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterFunc

func AfterFunc(duration time.Duration, f func())

AfterFunc is similar to time.AfterFunc

func BeginOfDay

func BeginOfDay(t time.Time) time.Time

BeginOfDay returns the beginning of the day

func BeginOfMouth

func BeginOfMouth(t time.Time) time.Time

BeginOfMouth returns the beginning of the month

func BeginOfWeek

func BeginOfWeek(t time.Time) time.Time

BeginOfWeek Return the beginning of the week

func DayPass

func DayPass(begin time.Time, end time.Time) int64

DayPass Calculate how many days have passed between begin and end

func EndOfDay

func EndOfDay(t time.Time) time.Time

EndOfDay returns the end of the day

func EndOfWeek

func EndOfWeek(t time.Time) time.Time

EndOfWeek returns the end of the week

func LastDay

func LastDay(t time.Time) time.Time

LastDay Return to the same time on the previous day

func MillisecondToTime

func MillisecondToTime(millisecond int64) (h int64, m int64, s int64)

MillisecondToTime Convert milliseconds to hour, minute, second

func NextDay

func NextDay(t time.Time) time.Time

NextDay Return to the same time of the next day

func SecondToTime

func SecondToTime(second int64) (h int64, m int64, s int64)

SecondToTime Convert seconds to hour, minute, second

func Ticker

func Ticker(duration time.Duration, f func() bool)

Ticker Execute function f every interval duration

func TimeStampToString

func TimeStampToString(nTimer int64) string

TimeStampToString Convert timestamp to string

func UntilFunc

func UntilFunc(t time.Time, f func())

UntilFunc Until the specified time executes function f

Types

This section is empty.

Jump to

Keyboard shortcuts

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