Commit cae530ae authored by ale's avatar ale

remove useless time.Now call

parent c0ff2ab8
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment