stopwatch

package
v0.0.0-...-937ee59 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package stopwatch provides simple way to measure time between certain calls

sw := stopwatch.New()

funcToMeasure()
sw.Lap("my func")

nextFuncToMeasure()
sw.Lap("next func")

go sendToInflux(sw.Laps())

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stopwatch

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

Stopwatch performance metering

func New

func New() *Stopwatch

New creates stopwatch instance

func (*Stopwatch) Lap

func (sw *Stopwatch) Lap(name string)

Lap records new mesure since last

func (*Stopwatch) Laps

func (sw *Stopwatch) Laps() map[string]time.Duration

Laps returns current measured times

func (*Stopwatch) String

func (sw *Stopwatch) String() string

String returns json marshaled laps

Jump to

Keyboard shortcuts

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