Don't get time.Now() again when we just got it

This commit is contained in:
Paul Lorenz
2022-03-30 23:22:32 -04:00
parent 7bd0f84832
commit c2a59e7dda
+1 -1
View File
@@ -178,7 +178,7 @@ func (self *heartbeatCallback) HeartbeatRespTx(int64) {}
func (self *heartbeatCallback) HeartbeatRespRx(ts int64) {
now := time.Now()
self.lastResponse = now.UnixMilli()
self.latencyMetric.Update(time.Now().UnixNano() - ts)
self.latencyMetric.Update(now.UnixNano() - ts)
}
func (self *heartbeatCallback) CheckHeartBeat() {