timer

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stopped timerState = iota
	Started
	Paused
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiPartSetter

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

A setter that can have distinct part or sections. By using a MultiPartSetter one can time distinct sections of code and have their individuals times summed to form a total timed value.

func NewMultiPartSetter

func NewMultiPartSetter(setter Setter) *MultiPartSetter

func (*MultiPartSetter) NewPart

func (mp *MultiPartSetter) NewPart() Setter

Add a new distinct part. As new timings are set for this part they will contribute to the total time.

func (*MultiPartSetter) Stop

func (mp *MultiPartSetter) Stop()

type Setter

type Setter interface {
	Set(int64)
}

A variable that is settable. The use of this interface allows for control on how the averaged timed value accessed.

type Timer

type Timer interface {
	// Start the timer
	// Timer must be stopped, which is the state of a new timer.
	Start()
	// Pause the timer.
	// Timer must be started.
	Pause()
	// Resumed the timer.
	// Timer must be paused.
	Resume()
	// Stop the timer.
	// Timer must be started.
	Stop()
}

func New

func New(sampleRate float64, movingAverageSize int, avgVar Setter) Timer

func NewNoOp

func NewNoOp() Timer

Jump to

Keyboard shortcuts

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