Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for BenchmarkCompareStringIdentical (0.18 sec)

  1. src/runtime/string_test.go

    	bytes := []byte("Hello Gophers!")
    	s1, s2 := string(bytes), string(bytes)
    	for i := 0; i < b.N; i++ {
    		if s1 != s2 {
    			b.Fatal("s1 != s2")
    		}
    	}
    }
    
    func BenchmarkCompareStringIdentical(b *testing.B) {
    	s1 := "Hello Gophers!"
    	s2 := s1
    	for i := 0; i < b.N; i++ {
    		if s1 != s2 {
    			b.Fatal("s1 != s2")
    		}
    	}
    }
    
    func BenchmarkCompareStringSameLength(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 13 14:05:23 UTC 2022
    - 13.3K bytes
    - Viewed (0)
Back to top