ts

package
v0.0.0-...-65546df Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromUnix

func FromUnix(ts int64) time.Time

FromUnix return time.Time from unix timestamp

func FromUnixMicro

func FromUnixMicro(ts int64) time.Time

FromUnixMicro returns time.Time from the unix timestamp

func In

func In(loc *time.Location)

In updates local time zone

func Location

func Location() *time.Location

Location return local time zone

func Now

func Now() time.Time

Now returns not time

func Unix

func Unix() int64

Unix returns the unix timestamp for now

func UnixMicro

func UnixMicro() int64

UnixMicro returns the unix micro timestamp for

func Zero

func Zero() time.Time

Zero return zero value for time.Time

Types

type Timer

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

Timer is a thread safe simple timer

func NewTimer

func NewTimer() *Timer

func (*Timer) Begin

func (t *Timer) Begin()

Begin begins timer

func (*Timer) Duration

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

Duration return the duration between startAt and stopAt.

func (*Timer) Reset

func (t *Timer) Reset()

Reset resets timer

func (*Timer) Stop

func (t *Timer) Stop()

Stop stops timer

Jump to

Keyboard shortcuts

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