A benchmark function in Go receives a pointer to a _____ as its parameter.

  • testing.B
  • benchmark.B
  • testing.T
  • benchmark.T
A benchmark function in Go receives a pointer to a testing.B as its parameter. The testing.B type provides methods and fields for controlling and reporting the benchmark's progress and results. By receiving this parameter, the benchmark function can use it to record timings, perform iterations, and report the benchmark's outcomes, including memory allocations and custom metrics if needed.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *