bench

package
v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicCounter

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

AtomicCounter implements an atmoic lock using the atomic package

func (*AtomicCounter) Add

func (c *AtomicCounter) Add(amount int64)

Add increments the counter

func (*AtomicCounter) Read

func (c *AtomicCounter) Read() int64

Read returns the current counter amount

type Counter

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

Counter uses a sync.RWMutex to safely modify a value

func (*Counter) Add

func (c *Counter) Add(amount int64)

Add increments the counter

func (*Counter) Read

func (c *Counter) Read() int64

Read returns the current counter amount

Jump to

Keyboard shortcuts

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