MCPcopy
hub / github.com/google/uuid / BenchmarkUUID_String

Function BenchmarkUUID_String

uuid_test.go:692–702  ·  uuid_test.go::BenchmarkUUID_String
(b *testing.B)

Source from the content-addressed store, hash-verified

690}
691
692func BenchmarkUUID_String(b *testing.B) {
693 uuid, err := Parse("f47ac10b-58cc-0372-8567-0e02b2c3d479")
694 if err != nil {
695 b.Fatal(err)
696 }
697 for i := 0; i < b.N; i++ {
698 if uuid.String() == "" {
699 b.Fatal("invalid uuid")
700 }
701 }
702}
703
704func BenchmarkUUID_URN(b *testing.B) {
705 uuid, err := Parse("f47ac10b-58cc-0372-8567-0e02b2c3d479")

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected