1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 14:42:27 +08:00

feat: add DaysBetween in datetime package

This commit is contained in:
dudaodong
2024-09-09 10:55:18 +08:00
parent 5e3337a52e
commit 48244d6711
5 changed files with 127 additions and 10 deletions

View File

@@ -409,16 +409,14 @@ func ExampleIsWeekend() {
// false
}
// func ExampleTrackFuncTime() {
// defer TrackFuncTime(time.Now())()
func ExampleDaysBetween() {
start := time.Date(2024, time.September, 1, 0, 0, 0, 0, time.UTC)
end := time.Date(2024, time.September, 10, 0, 0, 0, 0, time.UTC)
// var n int
// for i := 0; i < 5000000; i++ {
// n++
// }
result := DaysBetween(start, end)
// fmt.Println(1)
fmt.Println(result)
// // Output:
// // 1
// }
// Output:
// 9
}