carbon/test_bench_test.go
2024-01-07 20:03:45 +08:00

25 lines
403 B
Go
Executable File

package carbon
import "testing"
func BenchmarkCarbon_SetTestNow(b *testing.B) {
c := NewCarbon()
for n := 0; n < b.N; n++ {
c.SetTestNow(Yesterday())
}
}
func BenchmarkCarbon_UnSetTestNow(b *testing.B) {
c := NewCarbon()
for n := 0; n < b.N; n++ {
c.UnSetTestNow()
}
}
func BenchmarkCarbon_IsSetTestNow(b *testing.B) {
c := NewCarbon()
for n := 0; n < b.N; n++ {
c.IsSetTestNow()
}
}