mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
[skip ci]Fix golint warnings in timerecord (#9104)
Signed-off-by: Xiangyu Wang <xiangyu.wang@zilliz.com>
This commit is contained in:
parent
02b2f3c88b
commit
71b7e768e7
@ -18,6 +18,7 @@ import (
|
||||
"github.com/milvus-io/milvus/internal/log"
|
||||
)
|
||||
|
||||
// TimeRecorder provides methods to record time duration
|
||||
type TimeRecorder struct {
|
||||
header string
|
||||
start time.Time
|
||||
@ -33,6 +34,7 @@ func NewTimeRecorder(header string) *TimeRecorder {
|
||||
}
|
||||
}
|
||||
|
||||
// RecordSpan return the duration from last record
|
||||
func (tr *TimeRecorder) RecordSpan() time.Duration {
|
||||
curr := time.Now()
|
||||
span := curr.Sub(tr.last)
|
||||
@ -40,6 +42,7 @@ func (tr *TimeRecorder) RecordSpan() time.Duration {
|
||||
return span
|
||||
}
|
||||
|
||||
// ElapseSpan return the duration from the beginning
|
||||
func (tr *TimeRecorder) ElapseSpan() time.Duration {
|
||||
curr := time.Now()
|
||||
span := curr.Sub(tr.start)
|
||||
|
Loading…
Reference in New Issue
Block a user