Benchmark
benchmarking measures the performance of a function or program. This allows you to compare implementations and understand the impact of changes made to your code.
In Go, functions that take the form 'func BenchmarkXxx(*testing.B)' are considered benchmarks. go test will run these benchmarks when you supply the -bench flag. Benchmarks are run sequentially.
> go test -bench=.
// Output:
goos: windows
goarch: amd64
pkg: math
BenchmarkAdd-4 1000000000 1.07 ns/op
PASS
ok ./math 2.074s
The resulting output means that the loop executed 10,000,000 times at a speed of 1.07 nanoseconds per loop.