time

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
	Ticker(duration time.Duration) Ticker
}

Clock keeps track of time for a metric SDK.

type RealClock

type RealClock struct {
}

RealClock wraps the time package and uses the system time to tell time.

func (RealClock) Now

func (RealClock) Now() time.Time

Now returns the current time.

func (RealClock) Ticker

func (RealClock) Ticker(period time.Duration) Ticker

Ticker creates a new RealTicker that will tick with period.

type RealTicker

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

RealTicker wraps the time package and uses system time to tick time intervals.

func (RealTicker) C

func (t RealTicker) C() <-chan time.Time

C returns a channel that receives the current time when RealTicker ticks.

func (RealTicker) Stop

func (t RealTicker) Stop()

Stop turns off the RealTicker.

type Ticker

type Ticker interface {
	Stop()
	C() <-chan time.Time
}

Ticker signals time intervals.

Jump to

Keyboard shortcuts

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