diff --git a/tunnel/statistic/manager.go b/tunnel/statistic/manager.go index 08747118..0b309299 100644 --- a/tunnel/statistic/manager.go +++ b/tunnel/statistic/manager.go @@ -114,10 +114,8 @@ func (m *Manager) handle() { ticker := time.NewTicker(time.Second) for range ticker.C { - m.uploadBlip.Store(m.uploadTemp.Load()) - m.uploadTemp.Store(0) - m.downloadBlip.Store(m.downloadTemp.Load()) - m.downloadTemp.Store(0) + m.uploadBlip.Store(m.uploadTemp.Swap(0)) + m.downloadBlip.Store(m.downloadTemp.Swap(0)) } }