Benchmarks: Use b.Loop() to simplify the code and enhance performance #5226

Signed-off-by: letreturn <letreturn@outlook.com>
This commit is contained in:
letreturn
2025-10-02 23:00:13 +08:00
committed by GitHub
parent 1d984fb8b0
commit c57cacb834
6 changed files with 13 additions and 13 deletions

View File

@@ -80,7 +80,7 @@ func TestGenerateUID(t *testing.T) {
}
func BenchmarkGenerateUID(b *testing.B) {
for n := 0; n < b.N; n++ {
for b.Loop() {
GenerateUID('x')
}
}