Standard library / testing

testing.B.ResetTimer()

Reset elapsed time and allocation counters after setup. Expected stdout: 'true\nPASS\n'. Run as a _test.go file using the Go test harness.

Formal Syntax & Structure

go syntaxgo
func (b *B) ResetTimer()

Working Example

Example Snippetgo
package main
import (  "fmt"  "testing")
func TestReference(t *testing.T) {  r := testing.Benchmark(func(b *testing.B) {    b.ResetTimer()    for j := 0; j < b.N; j++ {    }  })  fmt.Println(r.N > 0)}
Go Reference