microbenchmark

package module
v0.0.0-...-8927b88 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: MIT Imports: 1 Imported by: 1

README

go-microbenchmark

micro benchmark library

feature

  1. measure running time some functions
bench := NewBenchmark()
elapsed := bench.Benchmark(
  func() { ... },
  func() { ... },
  func() { ... },
)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Benchmark

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

Benchmark object

func NewBenchmark

func NewBenchmark() *Benchmark

Create default benhcmark object

func (*Benchmark) Begin

func (b *Benchmark) Begin()

begin benchmark

func (*Benchmark) Benchmark

func (b *Benchmark) Benchmark(args ...func()) (result time.Duration)

measure args functions. return all functions sum elapsed time

func (*Benchmark) End

func (b *Benchmark) End() time.Duration

end benchmark, return since Begin() to End() elapsed time

Jump to

Keyboard shortcuts

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