chrono

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRetry

func DoRetry(delay time.Duration, retry int, do func() error)

func FmtDuration

func FmtDuration(d time.Duration) string

func SplitDuration

func SplitDuration(d time.Duration) [3]uint

Types

type DelayedExec

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

func NewDelayedExec

func NewDelayedExec(duration time.Duration, waitIfTooFast bool) *DelayedExec

func (*DelayedExec) Exec

func (d *DelayedExec) Exec(_fct func())

type StopWatch

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

func NewStopWatch

func NewStopWatch(start bool) *StopWatch

func (*StopWatch) Add

func (c *StopWatch) Add(duration time.Duration)

func (*StopWatch) Elapsed

func (c *StopWatch) Elapsed() time.Duration

func (*StopWatch) IsRunning

func (c *StopWatch) IsRunning() bool

func (*StopWatch) Reset

func (c *StopWatch) Reset()

func (*StopWatch) ResetTo

func (c *StopWatch) ResetTo(duration time.Duration)

func (*StopWatch) Start

func (c *StopWatch) Start()

func (*StopWatch) Stop

func (c *StopWatch) Stop()

Jump to

Keyboard shortcuts

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