debug

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTimePoint

func AddTimePoint() time.Time

func AddTimePointWithLabel

func AddTimePointWithLabel(label string) time.Time

func PrintAll

func PrintAll() error

func Reset

func Reset()

func TimeElapsed

func TimeElapsed() (d1 time.Duration, d2 time.Duration)

func TimeElapsedAfterLabel

func TimeElapsedAfterLabel(label string) (dur time.Duration, err error)

func Verbose

func Verbose()

Types

type Stopwatch

type Stopwatch struct {
	TimePoints []time.Time
	Labels     map[string]int
	LabelsRev  map[int]string
	// contains filtered or unexported fields
}

func NewStopwatch

func NewStopwatch() *Stopwatch

func (*Stopwatch) AddTimePoint

func (sw *Stopwatch) AddTimePoint() time.Time

func (*Stopwatch) AddTimePointWithLabel

func (sw *Stopwatch) AddTimePointWithLabel(label string) time.Time

func (*Stopwatch) GetTimeByLabel

func (sw *Stopwatch) GetTimeByLabel(label string) (time.Time, bool)

func (*Stopwatch) PrintAll

func (sw *Stopwatch) PrintAll() error

func (*Stopwatch) Reset

func (sw *Stopwatch) Reset()

func (*Stopwatch) TimeElapsed

func (sw *Stopwatch) TimeElapsed() (d1 time.Duration, d2 time.Duration)

return elapsed time it will return 2 results, the first is the duration before the previous one the second is the duration of all

func (*Stopwatch) TimeElapsedAfterLabel

func (sw *Stopwatch) TimeElapsedAfterLabel(label string) (dur time.Duration, err error)

Jump to

Keyboard shortcuts

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