2023-12-28 11:27:27 +08:00
|
|
|
package carbon
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsDST(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsDST()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsDST()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsZero(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsZero()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsZero()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsValid(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsZero()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsZero()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsInvalid(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsInvalid()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsInvalid()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
2024-01-12 10:57:10 +08:00
|
|
|
func BenchmarkCarbon_IsAM(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsAM()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsPM(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsPM()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-28 11:27:27 +08:00
|
|
|
func BenchmarkCarbon_IsNow(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsNow()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsNow()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsFuture(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsFuture()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsFuture()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsPast(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsPast()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsPast()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsLeapYear(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsLeapYear()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsLeapYear()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsLongYear(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsLongYear()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsLongYear()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsJanuary(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsJanuary()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsJanuary()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsFebruary(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsFebruary()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsFebruary()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsMarch(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsMarch()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsMarch()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsApril(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsApril()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsApril()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsMay(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsMay()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsMay()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsJune(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsJune()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsJune()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsJuly(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsJuly()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsJuly()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsAugust(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsAugust()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsAugust()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSeptember(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSeptember()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSeptember()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsOctober(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsOctober()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsOctober()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsNovember(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsNovember()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsNovember()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsDecember(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsDecember()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsDecember()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsMonday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsMonday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsMonday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsTuesday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsTuesday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsTuesday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsWednesday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsWednesday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsWednesday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsThursday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsThursday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsThursday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsFriday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsFriday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsFriday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSaturday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSaturday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSaturday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSunday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSunday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSunday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsWeekday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsWeekday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsWeekday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsWeekend(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsWeekend()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsWeekend()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsYesterday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsYesterday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsYesterday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsToday(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsToday()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsToday()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsTomorrow(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsTomorrow()
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsTomorrow()
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameCentury(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameCentury(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameCentury(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameDecade(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameDecade(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameDecade(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameYear(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameYear(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameYear(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameQuarter(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameQuarter(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameQuarter(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameMonth(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameMonth(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameMonth(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameDay(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameDay(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameDay(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameHour(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameHour(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameHour(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameMinute(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameMinute(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameMinute(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_IsSameSecond(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.IsSameSecond(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().IsSameSecond(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_Compare(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.Compare(">", Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().Compare(">", Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_Gt(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.Gt(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().Gt(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_Lt(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.Lt(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().Lt(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_Eq(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.Eq(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().Eq(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_Ne(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.Ne(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().Ne(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_Gte(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.Gte(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().Gte(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_Lte(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.Lte(Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().Lte(Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_Between(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.Between(Tomorrow(), Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().Between(Tomorrow(), Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_BetweenIncludedStart(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.BetweenIncludedStart(Tomorrow(), Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().BetweenIncludedStart(Tomorrow(), Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_BetweenIncludedEnd(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.BetweenIncludedEnd(Tomorrow(), Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().BetweenIncludedEnd(Tomorrow(), Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkCarbon_BetweenIncludedBoth(b *testing.B) {
|
|
|
|
now := Now()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
now.BetweenIncludedBoth(Tomorrow(), Yesterday())
|
|
|
|
}
|
2024-01-07 20:03:45 +08:00
|
|
|
for n := 0; n < b.N; n++ {
|
|
|
|
NewCarbon().BetweenIncludedBoth(Tomorrow(), Yesterday())
|
|
|
|
}
|
2023-12-28 11:27:27 +08:00
|
|
|
}
|