timex

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const Day time.Duration = 24 * time.Hour

Variables

This section is empty.

Functions

func Between

func Between(left, mid, right time.Duration) time.Duration

func From

func From(v int, unit time.Duration) time.Duration

func FromDay

func FromDay(sec int) time.Duration

func FromHour

func FromHour(sec int) time.Duration

func FromMicrosecond

func FromMicrosecond(sec int) time.Duration

func FromMillisecond

func FromMillisecond(sec int) time.Duration

func FromMinute added in v0.0.14

func FromMinute(sec int) time.Duration

func FromSecond

func FromSecond(sec int) time.Duration

func IsBetween

func IsBetween(left, mid, right time.Time) bool

IsBetween returns true if the time is between the two times.

func IsBetweenOrEqual added in v0.0.13

func IsBetweenOrEqual(left, mid, right time.Time) bool

IsBetweenOrEqual returns true if the time is between the two times or equal to one of them.

func NowIn

func NowIn(location string) (time.Time, error)

NowIn returns the current time in the given location.

Types

type Timer

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

func NewTimer

func NewTimer() *Timer

func (*Timer) Duration

func (t *Timer) Duration() time.Duration

func (*Timer) Elapsed

func (t *Timer) Elapsed() time.Duration

func (*Timer) IsStarted

func (t *Timer) IsStarted() bool

func (*Timer) IsStopped

func (t *Timer) IsStopped() bool

func (*Timer) Reset

func (t *Timer) Reset()

func (*Timer) Start

func (t *Timer) Start()

func (*Timer) Stop

func (t *Timer) Stop()

Jump to

Keyboard shortcuts

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