func BenchmarkMutexInc(b *testing.B) {
	var mu sync.Mutex
	var myVar uint64
	b.RunParallel(func(pb *testing.PB) {
		for pb.Next() {
			mu.Lock()
			myVar++
			mu.Unlock()
		}
	})
}
BenchmarkMutexInc increments a `uint64` with a sync.Mutex lock.
package main
import (
	"sync"
	"sync/atomic"
	"testing"
	uuid "github.com/satori/go.uuid"
)
func BenchmarkAtomicAddInc(b *testing.B) {
	var myVar uint64
	b.RunParallel(func(pb *testing.PB) {
		for pb.Next() {
			atomic.AddUint64(&myVar, 1)
		}
	})
}
func BenchmarkAtomicLoadStoreInc(b *testing.B) {
	var myVar uint64
	b.RunParallel(func(pb *testing.PB) {
		for pb.Next() {
			current := atomic.LoadUint64(&myVar)
			current++
			atomic.StoreUint64(&myVar, current)
		}
	})
}
func BenchmarkAtomicSwapInc(b *testing.B) {
	var myVar uint64
	b.RunParallel(func(pb *testing.PB) {
		for pb.Next() {
		finished:
			for {
				oldValue := atomic.LoadUint64(&myVar)
				newValue := oldValue + 1
				if atomic.CompareAndSwapUint64(&myVar, oldValue, newValue) {
					break finished
				}
			}
		}
	})
}