carbon/encoding_bench_test.go
2023-12-28 11:27:27 +08:00

18 lines
274 B
Go
Executable File

package carbon
import "testing"
func BenchmarkCarbon_MarshalJSON(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.MarshalJSON()
}
}
func BenchmarkCarbon_UnmarshalJSON(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.UnmarshalJSON(nil)
}
}