From af48d5a016d40698abbe47c0a942780f26c2c5dc Mon Sep 17 00:00:00 2001 From: public_host Date: Mon, 6 Jan 2025 14:20:30 +0800 Subject: [PATCH] update --- core.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core.go b/core.go index 64697ff..0e5af24 100644 --- a/core.go +++ b/core.go @@ -476,9 +476,14 @@ func (th *TimeArrowHelper) GetHitTimeArrow(t time.Time, group string, expandTags if err != nil { return nil, err } + + sliceStartTime := time.Now() sort.Slice(ta, func(i, j int) bool { return ta[i].Weights > ta[j].Weights }) + log.Println("Slice排序耗时:", time.Since(sliceStartTime)) + + forStart := time.Now() for e := range ta { //当天具体时间判断 if !isInTimeOfDay(t, ta[e]) { @@ -531,5 +536,7 @@ func (th *TimeArrowHelper) GetHitTimeArrow(t time.Time, group string, expandTags // log.Println("类型错误:", ta[e].Type) } } + + log.Println("for循环耗时:", time.Since(forStart)) return nil, nil }