32 Star 408 Fork 63

GVPdromara/carbon

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
comparer_bench_test.go 9.52 KB
一键复制 编辑 原始数据 按行查看 历史
gouguoyin 提交于 2024-01-12 10:57 . v2.3.5
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
package carbon
import "testing"
func BenchmarkCarbon_IsDST(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsDST()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsDST()
}
}
func BenchmarkCarbon_IsZero(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsZero()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsZero()
}
}
func BenchmarkCarbon_IsValid(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsZero()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsZero()
}
}
func BenchmarkCarbon_IsInvalid(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsInvalid()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsInvalid()
}
}
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()
}
}
func BenchmarkCarbon_IsNow(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsNow()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsNow()
}
}
func BenchmarkCarbon_IsFuture(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsFuture()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsFuture()
}
}
func BenchmarkCarbon_IsPast(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsPast()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsPast()
}
}
func BenchmarkCarbon_IsLeapYear(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsLeapYear()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsLeapYear()
}
}
func BenchmarkCarbon_IsLongYear(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsLongYear()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsLongYear()
}
}
func BenchmarkCarbon_IsJanuary(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsJanuary()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsJanuary()
}
}
func BenchmarkCarbon_IsFebruary(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsFebruary()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsFebruary()
}
}
func BenchmarkCarbon_IsMarch(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsMarch()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsMarch()
}
}
func BenchmarkCarbon_IsApril(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsApril()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsApril()
}
}
func BenchmarkCarbon_IsMay(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsMay()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsMay()
}
}
func BenchmarkCarbon_IsJune(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsJune()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsJune()
}
}
func BenchmarkCarbon_IsJuly(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsJuly()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsJuly()
}
}
func BenchmarkCarbon_IsAugust(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsAugust()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsAugust()
}
}
func BenchmarkCarbon_IsSeptember(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSeptember()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSeptember()
}
}
func BenchmarkCarbon_IsOctober(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsOctober()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsOctober()
}
}
func BenchmarkCarbon_IsNovember(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsNovember()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsNovember()
}
}
func BenchmarkCarbon_IsDecember(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsDecember()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsDecember()
}
}
func BenchmarkCarbon_IsMonday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsMonday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsMonday()
}
}
func BenchmarkCarbon_IsTuesday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsTuesday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsTuesday()
}
}
func BenchmarkCarbon_IsWednesday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsWednesday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsWednesday()
}
}
func BenchmarkCarbon_IsThursday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsThursday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsThursday()
}
}
func BenchmarkCarbon_IsFriday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsFriday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsFriday()
}
}
func BenchmarkCarbon_IsSaturday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSaturday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSaturday()
}
}
func BenchmarkCarbon_IsSunday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSunday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSunday()
}
}
func BenchmarkCarbon_IsWeekday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsWeekday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsWeekday()
}
}
func BenchmarkCarbon_IsWeekend(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsWeekend()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsWeekend()
}
}
func BenchmarkCarbon_IsYesterday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsYesterday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsYesterday()
}
}
func BenchmarkCarbon_IsToday(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsToday()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsToday()
}
}
func BenchmarkCarbon_IsTomorrow(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsTomorrow()
}
for n := 0; n < b.N; n++ {
NewCarbon().IsTomorrow()
}
}
func BenchmarkCarbon_IsSameCentury(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameCentury(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameCentury(Yesterday())
}
}
func BenchmarkCarbon_IsSameDecade(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameDecade(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameDecade(Yesterday())
}
}
func BenchmarkCarbon_IsSameYear(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameYear(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameYear(Yesterday())
}
}
func BenchmarkCarbon_IsSameQuarter(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameQuarter(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameQuarter(Yesterday())
}
}
func BenchmarkCarbon_IsSameMonth(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameMonth(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameMonth(Yesterday())
}
}
func BenchmarkCarbon_IsSameDay(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameDay(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameDay(Yesterday())
}
}
func BenchmarkCarbon_IsSameHour(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameHour(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameHour(Yesterday())
}
}
func BenchmarkCarbon_IsSameMinute(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameMinute(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameMinute(Yesterday())
}
}
func BenchmarkCarbon_IsSameSecond(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.IsSameSecond(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().IsSameSecond(Yesterday())
}
}
func BenchmarkCarbon_Compare(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.Compare(">", Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().Compare(">", Yesterday())
}
}
func BenchmarkCarbon_Gt(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.Gt(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().Gt(Yesterday())
}
}
func BenchmarkCarbon_Lt(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.Lt(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().Lt(Yesterday())
}
}
func BenchmarkCarbon_Eq(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.Eq(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().Eq(Yesterday())
}
}
func BenchmarkCarbon_Ne(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.Ne(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().Ne(Yesterday())
}
}
func BenchmarkCarbon_Gte(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.Gte(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().Gte(Yesterday())
}
}
func BenchmarkCarbon_Lte(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.Lte(Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().Lte(Yesterday())
}
}
func BenchmarkCarbon_Between(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.Between(Tomorrow(), Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().Between(Tomorrow(), Yesterday())
}
}
func BenchmarkCarbon_BetweenIncludedStart(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.BetweenIncludedStart(Tomorrow(), Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().BetweenIncludedStart(Tomorrow(), Yesterday())
}
}
func BenchmarkCarbon_BetweenIncludedEnd(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.BetweenIncludedEnd(Tomorrow(), Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().BetweenIncludedEnd(Tomorrow(), Yesterday())
}
}
func BenchmarkCarbon_BetweenIncludedBoth(b *testing.B) {
now := Now()
for n := 0; n < b.N; n++ {
now.BetweenIncludedBoth(Tomorrow(), Yesterday())
}
for n := 0; n < b.N; n++ {
NewCarbon().BetweenIncludedBoth(Tomorrow(), Yesterday())
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/dromara/carbon.git
git@gitee.com:dromara/carbon.git
dromara
carbon
carbon
master

搜索帮助