mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-20 17:10:08 +08:00
chore: better atomic using
This commit is contained in:
parent
ecd8facd81
commit
990de84391
@ -114,10 +114,8 @@ func (m *Manager) handle() {
|
|||||||
ticker := time.NewTicker(time.Second)
|
ticker := time.NewTicker(time.Second)
|
||||||
|
|
||||||
for range ticker.C {
|
for range ticker.C {
|
||||||
m.uploadBlip.Store(m.uploadTemp.Load())
|
m.uploadBlip.Store(m.uploadTemp.Swap(0))
|
||||||
m.uploadTemp.Store(0)
|
m.downloadBlip.Store(m.downloadTemp.Swap(0))
|
||||||
m.downloadBlip.Store(m.downloadTemp.Load())
|
|
||||||
m.downloadTemp.Store(0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user