Standard library / testing

testing.PB

Parallel benchmark iterator passed to the worker callback; not a general worker pool. Expected stdout: 'true\nPASS\n'. Run as a _test.go file using the Go test harness.

Formal Syntax & Structure

go syntaxgo
type PB struct {}

Working Example

Example Snippetgo
package main
import (  "fmt"  "testing")
func TestReference(t *testing.T) {  r := testing.Benchmark(func(b *testing.B) {    b.RunParallel(func(pb *testing.PB) {      for pb.Next() {      }    })  })  fmt.Println(r.N > 0)}
Go Reference