mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
31 lines
421 B
Go
31 lines
421 B
Go
package id
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func BenchmarkGen(b *testing.B) {
|
|
for i := 0; i < b.N; i++ {
|
|
id := New()
|
|
_ = id
|
|
}
|
|
}
|
|
|
|
func BenchmarkMarshalText(b *testing.B) {
|
|
id := New()
|
|
for i := 0; i < b.N; i++ {
|
|
byts, _ := id.MarshalText()
|
|
_ = byts
|
|
}
|
|
}
|
|
|
|
func BenchmarkUnmarshalText(b *testing.B) {
|
|
id := New()
|
|
byts, _ := id.MarshalText()
|
|
for i := 0; i < b.N; i++ {
|
|
var id Id
|
|
id.UnmarshalText(byts)
|
|
_ = id
|
|
}
|
|
}
|