Which command is used to run benchmarks in Go?

  • go bench
  • go benchmark
  • go run -bench
  • go test -bench
The command used to run benchmarks in Go is go test -bench. This command executes any benchmark functions in the test files of the current package. It measures the performance of these benchmark functions and displays the results.
Add your answer
Loading...

Leave a comment

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