timer

package
v0.0.0-...-020e20f Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 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 Timer

type Timer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Timer defines a stop watch timer for performance analysis.

func NewTimer

func NewTimer() *Timer

NewTimer returns a new stop watch timer instance.

func (*Timer) Add

func (t *Timer) Add(name string)

Add records a time pivot.

func (*Timer) ToLogFields

func (t *Timer) ToLogFields() log.Fields

ToLogFields returns analysis results as log fields.

func (*Timer) ToMap

func (t *Timer) ToMap() map[string]time.Duration

ToMap returns analysis results as time duration map.

Jump to

Keyboard shortcuts

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