diff --git a/extremum_bench_test.go b/extremum_bench_test.go index 9471774..9d432af 100755 --- a/extremum_bench_test.go +++ b/extremum_bench_test.go @@ -5,7 +5,10 @@ import "testing" func BenchmarkCarbon_Closest(b *testing.B) { now := Now() for n := 0; n < b.N; n++ { - now.Closest(Parse("2020-08-05"), Parse("2022-08-05")) + now.Closest(Yesterday(), Yesterday().AddDay()) + } + for n := 0; n < b.N; n++ { + now.Closest(Yesterday().AddDay(), Yesterday()) } for n := 0; n < b.N; n++ { now.Closest(Parse("xxx"), Parse("2022-08-05")) @@ -18,7 +21,10 @@ func BenchmarkCarbon_Closest(b *testing.B) { func BenchmarkCarbon_Farthest(b *testing.B) { now := Now() for n := 0; n < b.N; n++ { - now.Farthest(Parse("2020-08-05"), Parse("2022-08-05")) + now.Farthest(now.AddYear(), Yesterday()) + } + for n := 0; n < b.N; n++ { + now.Farthest(Yesterday(), now.AddYear()) } for n := 0; n < b.N; n++ { now.Farthest(Parse("xxx"), Parse("2022-08-05"))