go.uuid/benchmarks_test.go

37 lines
581 B
Go
Raw Normal View History

2013-06-18 23:04:09 +04:00
package uuid_test
import (
"github.com/satori/uuid"
"testing"
)
func BenchmarkNewV1(b *testing.B) {
for i := 0; i < b.N; i++ {
uuid.NewV1()
}
}
func BenchmarkNewV2(b *testing.B) {
for i := 0; i < b.N; i++ {
uuid.NewV2(uuid.DomainPerson)
}
}
2013-06-18 23:04:09 +04:00
func BenchmarkNewV3(b *testing.B) {
for i := 0; i < b.N; i++ {
uuid.NewV3(uuid.NamespaceDNS, "www.example.com")
}
}
func BenchmarkNewV4(b *testing.B) {
for i := 0; i < b.N; i++ {
uuid.NewV4()
}
}
func BenchmarkNewV5(b *testing.B) {
for i := 0; i < b.N; i++ {
uuid.NewV5(uuid.NamespaceDNS, "www.example.com")
}
}