iterators

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 0 Imported by: 0

README

# go test -bench=.                                                                                                                                                     466ms
goos: linux
goarch: amd64
BenchmarkLoop10000000-2                      655           1732386 ns/op
BenchmarkCallback10000000-2                   80          15140141 ns/op
BenchmarkNext10000000-2                      799           1308199 ns/op
BenchmarkBufferedChan10000000-2               10         103415842 ns/op
BenchmarkUnbufferedChan10000000-2              4         299770165 ns/op
PASS
ok      _/home/smotouchi/github/workspace_2020/HighPerformanceWithGo/03-iterators-and-generators/iterators

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferedChanLoop

func BufferedChanLoop(n int) int

func CallbackLoop

func CallbackLoop(top int)

func NextLoop

func NextLoop(top int)

func UnbufferedChanLoop

func UnbufferedChanLoop(n int) int

Types

type CounterStruct

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

func NewCounterIterator

func NewCounterIterator(top int) *CounterStruct

func (*CounterStruct) Next

func (i *CounterStruct) Next() bool

func (*CounterStruct) Value

func (i *CounterStruct) Value() int

Jump to

Keyboard shortcuts

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