carbon/test_bench_test.go

25 lines
403 B
Go
Raw Permalink Normal View History

2023-12-28 11:27:27 +08:00
package carbon
import "testing"
func BenchmarkCarbon_SetTestNow(b *testing.B) {
2024-01-07 20:03:45 +08:00
c := NewCarbon()
2023-12-28 11:27:27 +08:00
for n := 0; n < b.N; n++ {
c.SetTestNow(Yesterday())
}
}
func BenchmarkCarbon_UnSetTestNow(b *testing.B) {
2024-01-07 20:03:45 +08:00
c := NewCarbon()
2023-12-28 11:27:27 +08:00
for n := 0; n < b.N; n++ {
c.UnSetTestNow()
}
}
func BenchmarkCarbon_IsSetTestNow(b *testing.B) {
2024-01-07 20:03:45 +08:00
c := NewCarbon()
2023-12-28 11:27:27 +08:00
for n := 0; n < b.N; n++ {
c.IsSetTestNow()
}
}