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