clock

package
v0.0.0-...-ea35677 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 3 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 {
	bclock.Clock
	Mono() MonotonicTime
}

Clock defines an interface that combines github.com/benbjohnson/clock.Clock and a Mono methods that can return a monotonic time duration

func New

func New() Clock

New creates a new withRealMono instance, which implements Clock interface

type Mock

type Mock struct {
	*bclock.Mock
}

Mock is a mock struct that implements Clock interface

func NewMock

func NewMock() *Mock

NewMock creates a new Mock instance

func (Mock) Mono

func (r Mock) Mono() MonotonicTime

Mono implements Clock.Mono

type MonotonicTime

type MonotonicTime time.Duration

MonotonicTime alias to time.Duration

func MonoNow

func MonoNow() MonotonicTime

MonoNow returns the MonotonicTime of current

func ToMono

func ToMono(t time.Time) MonotonicTime

ToMono converts time.Time to MonotonicTime

func (MonotonicTime) Sub

Sub returns time difference between two MonotonicTime

Jump to

Keyboard shortcuts

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