mirror of
https://gitee.com/dromara/carbon.git
synced 2024-12-02 04:07:36 +08:00
22 lines
385 B
Go
Executable File
22 lines
385 B
Go
Executable File
package carbon
|
|
|
|
import "testing"
|
|
|
|
func BenchmarkCarbon_Parse(b *testing.B) {
|
|
for n := 0; n < b.N; n++ {
|
|
Parse("2020-08-05")
|
|
}
|
|
}
|
|
|
|
func BenchmarkCarbon_ParseByFormat(b *testing.B) {
|
|
for n := 0; n < b.N; n++ {
|
|
ParseByFormat("2020-08-05", "Y-m-d")
|
|
}
|
|
}
|
|
|
|
func BenchmarkCarbon_ParseByLayout(b *testing.B) {
|
|
for n := 0; n < b.N; n++ {
|
|
ParseByLayout("2020-08-05", "2006-01-02")
|
|
}
|
|
}
|