metrics

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DOT_TICKER_DURATION = 250 // milliseconds
	DOT_SYMBOL          = "."
)

Variables

This section is empty.

Functions

func StartTimeIt

func StartTimeIt(message string, tickerSpeed int) int64

Start timer (stopwatch) returns ID for the timer If message="" (empty string) then it doesn't display anything and ticker automatically disabled! If ticker speed is 0, then use default value

func StopTimeIt

func StopTimeIt(id int64) time.Duration

Stop the timer without printing anything

func StopTimeItPrint

func StopTimeItPrint(id int64, message string) time.Duration

Stop timer with printing message, usually "Done" Output: ..... Done (duration) -- duration is with appropriate unit If message == "" then not printing anything

Types

type TimeIt

type TimeIt struct {
	ID         int64 // ID to match the StopTimer
	Message    string
	Start      time.Time
	WithTicker bool
	Ticker     *time.Ticker
	StopChan   chan bool
}

Jump to

Keyboard shortcuts

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