Skip to content
Snippets Groups Projects
Commit cae530ae authored by ale's avatar ale
Browse files

remove useless time.Now call

parent c0ff2ab8
No related branches found
No related tags found
No related merge requests found
......@@ -68,9 +68,8 @@ func (bw *BandwidthMonitor) Run(stop chan bool) {
t := time.NewTicker(bw.period)
for {
select {
case <-t.C:
case now := <-t.C:
if c, err := getBytesSentForDevice(bw.device); err == nil {
now := time.Now()
bw.lock.Lock()
bw.rate = float64(c-bw.counter) / now.Sub(bw.stamp).Seconds()
bw.counter = c
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment