title: Using testing.Benchmark does not produce any output
body: <p>I'm using <code>testing.Benchmark</code> to manually run a couple benchmarks but the result object is always empty.</p>
  
  <p>Am I missing something here?</p>
  
  <p>Here's an example:</p>
  
  <pre><code>package main
  
  import "testing"
  
  func main() {
  
      result := testing.Benchmark(func(parentB *testing.B) {
          parentB.Run("example", func(b *testing.B) {
              for n := 0; n &lt; b.N; n++ {
                  println("ok")
              }
          })
      })
  
      println(result.String())
  
  }
  </code></pre>
  
  <p>This will print <code>ok</code> a couple times and then <code>0          0 ns/op</code> but the benchmark clearly did run something.</p>