mirror of
https://gitee.com/dromara/carbon.git
synced 2024-11-30 03:07:36 +08:00
18 lines
274 B
Go
18 lines
274 B
Go
|
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)
|
||
|
}
|
||
|
}
|