timerecord

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeOverseer

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

TimeOverseer checks we receive at least one msg in d duration. If not, checker will print a warn message.

func NewTimeOverseer

func NewTimeOverseer(d time.Duration) *TimeOverseer

NewTimeOverseer creates a long term checker specified name, checking interval and warning string to print

func (*TimeOverseer) Reset

func (c *TimeOverseer) Reset()

Reset resets the time ticker

func (*TimeOverseer) Start

func (c *TimeOverseer) Start() <-chan struct{}

Start starts the check process

func (*TimeOverseer) Stop

func (c *TimeOverseer) Stop()

Stop stops the checker

type TimeRecorder

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

TimeRecorder provides methods to record time duration

func NewTimeRecorder

func NewTimeRecorder() *TimeRecorder

NewTimeRecorder creates a new TimeRecorder

func (*TimeRecorder) Duration

func (tr *TimeRecorder) Duration() time.Duration

Duration returns the duration from last record

func (*TimeRecorder) Elapse

func (tr *TimeRecorder) Elapse() time.Duration

Elapse returns the duration from the beginning

Jump to

Keyboard shortcuts

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