time

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MPL-2.0, MPL-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Datetime

func Datetime(c Clock) string

Datetime returns the UTC date+time in format YYYYMMDD-HHMM.

func DurationShort

func DurationShort(d std_time.Duration) string

Types

type Clock

type Clock interface {
	Now() std_time.Time
	NewTimer(std_time.Duration) Timer
}

type RealClock

type RealClock struct{}

func (RealClock) NewTimer

func (r RealClock) NewTimer(d std_time.Duration) Timer

func (RealClock) Now

func (r RealClock) Now() std_time.Time

Now returns the current UTC time.Time (unlike the standard lib which returns local).

type RealTimer

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

func (*RealTimer) C

func (f *RealTimer) C() <-chan std_time.Time

func (*RealTimer) Reset

func (f *RealTimer) Reset(d std_time.Duration) bool

func (*RealTimer) Stop

func (f *RealTimer) Stop() bool

type Timer

type Timer interface {
	Reset(std_time.Duration) bool
	Stop() bool
	C() <-chan std_time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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