func Ops(count, threads int, op func(i, thread int)) {
	var start time.Time
	var wg sync.WaitGroup
	wg.Add(threads)
	var ms1 runtime.MemStats
	output := Output
	if output != nil {
		if MemUsage {
			runtime.GC()
			runtime.ReadMemStats(&ms1)
		}
		start = time.Now()
	}
	for i := 0; i < threads; i++ {
		s, e := count/threads*i, count/threads*(i+1)
		if i == threads-1 {
			e = count
		}
		go func(i, s, e int) {
			defer wg.Done()
			for j := s; j < e; j++ {
				op(j, i)
			}
		}(i, s, e)
	}
	wg.Wait()
	if output != nil {
		dur := time.Since(start)
		var alloc uint64
		if MemUsage {
			runtime.GC()
			var ms2 runtime.MemStats
			runtime.ReadMemStats(&ms2)
			if ms1.HeapAlloc > ms2.HeapAlloc {
				alloc = 0
			} else {
				alloc = ms2.HeapAlloc - ms1.HeapAlloc
			}
		}
		WriteOutput(output, count, threads, dur, alloc)
	}
}
Ops executed a number of operations over a multiple goroutines.
count is the number of operations.
threads is the number goroutines.
op is the operation function
package lotsa
import (
	"fmt"
	"io"
	"runtime"
	"sync"
	"time"
)
var Output io.Writer
var MemUsage bool