You can specify the number of iterations for benchmarking using the _______ flag.
- -bench
- -count
- -iterations
- -n
The correct answer is "-n". In Go, when executing benchmarks, the -n flag is used to specify the number of iterations for benchmarking. This flag allows developers to control the duration and accuracy of benchmarking tests by adjusting the number of iterations performed. By tweaking this parameter, developers can obtain more precise performance measurements for their code.
Loading...
Related Quiz
- Explain the concept of error wrapping and how it's used in Go.
- What are the security considerations when designing a RESTful API?
- What happens if a slice exceeds its capacity while appending elements in Go?
- What is the primary package used in Go for SQL database access?
- Custom errors provide a way to _____ more information about the error conditions.